Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Cannot Reproduce
-
Affects Version/s: Next Major Release
-
Fix Version/s: None
-
Component/s: Zend_View
-
Labels:None
Description
Zend Framework RC 1.7 crashes Apache if you use the following code:
$form = new Zend_Form();
$form->setName('someFormName');
$form->addElement(new Zend_Form_Element_Text('id'));
^^ Crash
The problem is located in Zend_View_Helper_FormElement ~109:
// Set ID for element
if (isset($info['attribs']['id'])) {
$info['id'] = (string)$info['attribs']['id'];
}
}
For the code above, $info['attribs']['id'] has the value of Zend_View_Helper_FormElement and could not be casted to string.
Either patch the code part with:
if (isset($info['attribs']['id'])) {
if (is_object($info['attribs']['id']))
else
{ $info['id'] = (string)$info['attribs']['id']; }}
or disallow the use of 'id' for the name-attribute in form elements.
I supposed the bug exists in previous versions too.
I just used the latest svn branch with the exact same code that you posted and here is what it output in the browser
Can you provide information to help support this case?