Issues

ZF-10387: function _addDisplayGroupObject has to remove elements from Zend_Form - else rendering the elements twice

Issue Type: Bug Created: 2010-08-27T02:40:05.000+0000 Last Updated: 2011-09-22T19:24:13.000+0000 Status: Resolved Fix version(s): Reporter: Benjamin Heek (benovie) Assignee: Richard Tuin (richardtuin) Tags: - Zend_Form

Related issues: - ZF-11729

Attachments:

Description

When you add an object of Zend_Form_DisplayGroup to the Zend_Form it will not remove the elements in Zend_Form. When rendering the form, it will render the elements twice. (in the decorator FormElements of Zend_Form and the in the decorator for the Zend_Form_DisplayGroup)

testcase: (it will render the element test twice)

<pre class="highlight">
$oForm = new Zend_Form();
$oForm->addElement('text','test');
        
$oDisplayGroup = new Zend_Form_DisplayGroup('bug',$oForm->getPLuginLoader('decorator'));
$oDisplayGroup->addElement($oForm->getElement('test'));
$oForm->addDisplayGroups(array($oDisplayGroup));
echo $oForm;

solution: add following code in _addDisplayGroupObject in Zend_Form (it will remove the elements from the ordering in Zend_Form, so they won't be rendered)

<pre class="highlight">
foreach ($group->getElements() as $element) {
    unset($this->_order[$element->getName()]);
}

Comments

Posted by Matthew Weier O'Phinney (matthew) on 2010-08-27T07:50:23.000+0000

Can you detail:

  • What are your expectations? In other words, when you perform X, you expect Y to happen.
  • What actually happens? In other words, when you perform X, you expect Y to happen, but instead Z happens.

Your report presents a solution, but it doesn't clearly state what the problem is. It's entirely possible that it's by design, but we cannot be certain until we have this information.

Thanks!

Posted by Benjamin Heek (benovie) on 2010-08-27T08:45:48.000+0000

edited description with the real problem

Posted by Richard Tuin (richardtuin) on 2011-01-20T14:07:37.000+0000

I believe this issue relates to ZF-10958

Posted by Richard Tuin (richardtuin) on 2011-09-22T19:24:13.000+0000

Issue ZF-11729 is a duplicate of this and is resolved/fixed.

Have you found an issue?

See the Overview section for more details.

Copyright

© 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.

Contacts