ZF-4977: SubmitButton labels aren't getting rendered

Issue Type: Bug Created: 2008-11-18T11:36:30.000+0000 Last Updated: 2008-12-21T05:51:39.000+0000 Status: Resolved Fix version(s): - 1.7.1 (01/Dec/08)

Reporter: Dannel Albert (aaronexodus) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Dojo

Related issues: - ZF-4980



I upgraded to the release version of 1.7.0 after using the 1.7.0 RC and noticed a bug right away. SubmitButton labels weren't getting rendered.

It seems that something has changed in the way SubmitButtons are handled internally and the SubmitButton view helper needs to be updated. From the perspective of the SubmitButton view helper, the label is now stored in the $attribs['content'] field, not the $params['label'] field nor $value.

I made a change to line 54 in Zend/Dojo/View/Helper/SubmitButton.php that fixes the issue

$params['label'] = array_key_exists('content', $attribs) ? $attribs['content'] : $value;

The array_key_exists test is probably unnecessary since I noticed $attribs['content'] contains the name of the button if there is no label, but I like to pad my code for unforseen errors & future changes :)


Posted by Matthew Weier O'Phinney (matthew) on 2008-11-18T12:31:38.000+0000

Fixed in trunk in r12691, and merged to 1.7 release branch in r12692.

Posted by Matthew Weier O'Phinney (matthew) on 2008-11-19T10:26:43.000+0000

Just want to note...

Using the form element, you have the following workaround available until you are able to upgrade:

<pre class="highlight">
$element->setDijitParam("label", );

// or, at creation
$form->addElement('SubmitButton', 'submit', array(
    'label' => ,
    'dijitParams' => array('label' => ),

In the view helper, specify a label parameter in the dijitParams argument:

<pre class="highlight">
$view->submitButton('submit', 'Label', array('label' => 'Label'));

If you specify both, your code will continue to work in the future as well.

Have you found an issue?

See the Overview section for more details.


© 2006-2022 by Zend by Perforce. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.