ZF-7054: Zend_Form_Decorator_Fieldset does not recognize custom html ids.
Description
change lines 133-136 of Zend_Form_Decorator_Fieldset.php from:
$id = $element->getId();
if (!empty($id)) {
$attribs['id'] = 'fieldset-' . $id;
}
to:
$id = $element->getId();
if (!isset($attribs['id']) && !empty($id)) {
$attribs['id'] = 'fieldset-' . $id;
}
Comments
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.