Issues

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

Fixed in trunk r21966 and merged into 1.10 release branch.

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?

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

solves the problem.