ZF-7054: Zend_Form_Decorator_Fieldset does not recognize custom html ids.

Issue Type: Sub-task Created: 2009-06-19T12:15:55.000+0000 Last Updated: 2011-06-09T07:30:08.000+0000 Status: Resolved Fix version(s): - 1.10.4 (28/Apr/10)

Reporter: George Cooksey (ssbg) Assignee: Christian Albrecht (alab) Tags: - Zend_Form

Related issues: - ZF-8822



change lines 133-136 of Zend_Form_Decorator_Fieldset.php from:

<pre class="highlight">$id = $element->getId();
if (!empty($id)) {
    $attribs['id'] = 'fieldset-' . $id;


<pre class="highlight">$id = $element->getId();
if (!isset($attribs['id']) && !empty($id)) {
    $attribs['id'] = 'fieldset-' . $id;


Posted by Christian Albrecht (alab) on 2010-04-21T16:22:31.000+0000

Fixed in trunk r21966 and merged into 1.10 release branch.

Posted by Aurimas (aur1mas) on 2011-06-09T07:21:07.000+0000

Now I have a test case, which looks like this: $this->setAttrib('id', 'form-id'); $this->setDecorators(array( 'FormElements', array('Fieldset', array('legend' => $this->view->translate('Data'), 'id' => 'fieldset-id')), 'Form', array('Description', array('class' => 'placebo')), ));

But renderer renders form->id as fieldset->id & I have to identical ids for separate elements. Is it a bug or I'm missing something?

Posted by Aurimas (aur1mas) on 2011-06-09T07:30:08.000+0000

Changing Fieldset.php line: 75 from: $options = array_merge($options, $attribs); to: $options = array_merge($attribs, $options);

solves the problem.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

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