Zend Framework

SubmitButton labels aren't getting rendered

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.7.0
  • Fix Version/s: 1.7.1
  • Component/s: Zend_Dojo
  • Labels:
    None

Description

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

Issue Links

Activity

Hide
Matthew Weier O'Phinney added a comment -

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

Show
Matthew Weier O'Phinney added a comment - Fixed in trunk in r12691, and merged to 1.7 release branch in r12692.
Hide
Matthew Weier O'Phinney added a comment -

Just want to note...

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

$element->setDijitParam("label", <label value>);

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

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

$view->submitButton('submit', 'Label', array('label' => 'Label'));

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

Show
Matthew Weier O'Phinney added a comment - Just want to note... Using the form element, you have the following workaround available until you are able to upgrade:
$element->setDijitParam("label", <label value>);

// or, at creation
$form->addElement('SubmitButton', 'submit', array(
    'label' => <label value>,
    'dijitParams' => array('label' => <label value>),
));
In the view helper, specify a label parameter in the dijitParams argument:
$view->submitButton('submit', 'Label', array('label' => 'Label'));
If you specify both, your code will continue to work in the future as well.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: