ZF-3896: Zend_Form_Decorator_Fieldset uses form's class attribute if both attributes are set
Description
In Zend_Form_Decorator_Fieldset line 73, the line $options = array_merge($options, $attribs);
should be
$options = array_merge($attribs, $options);
This is because the current version overwrites specified attribs if they are the same as the Form.
For example, let's take a form:
$form = new Zend_Form(); $form->setAttrib ( 'class', 'FormClass' ); $form->addDecorator('Fieldset',array('class'=>'FieldsetClass'));
The fieldset would be rendered with the FormClass instead of FieldsetClass as expected.
Comments
Posted by Fabio Almeida (fabius) on 2009-07-02T17:55:18.000+0000
I confirm the bug AND the fix to be functional with release 1.7.4. It's not just Zend_Form, any other form object using the "Fieldset" decorator will generate this problem.
Posted by Ramon Henrique Ornelas (ramon) on 2010-11-27T05:35:43.000+0000
Fixed with issue ZF-10679.