ZF-3896: Zend_Form_Decorator_Fieldset uses form's class attribute if both attributes are set

Issue Type: Sub-task Created: 2008-08-08T04:09:14.000+0000 Last Updated: 2010-11-27T05:35:44.000+0000 Status: Resolved Fix version(s): - 1.11.1 (30/Nov/10)

Reporter: Patriche Daniel (thor) Assignee: Ramon Henrique Ornelas (ramon) Tags: - Zend_Form

Related issues: - ZF-8822



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.


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.

Have you found an issue?

See the Overview section for more details.


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

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