Issues

ZF2-544: Collection extract method updates targetElement object to an existing value

Issue Type: Bug Created: 2012-09-11T09:11:08.000+0000 Last Updated: 2012-10-08T20:14:34.000+0000 Status: Closed Fix version(s): Reporter: Oliver Leisalu (inditel) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend\Form

Related issues: Attachments:

Description

Collection extract method updates targetElement object property into an existing value. This will cause a lot of problems if adding new elements is allowed.

In extract method foreach cluase current code: $this->targetElement->object = $value; $values[$key] = $this->targetElement->extract();

It should be something like this: $prevValue = $this->targetElement->object; $this->targetElement->object = $value; $values[$key] = $this->targetElement->extract(); $this->targetElement->object = $prevValue;

If this is not done, targetElement will have values from the last object that was in the list - for example ID.

Comments

Posted by Ralph Schindler (ralph) on 2012-10-08T20:14:34.000+0000

This issue has been closed on Jira and moved to GitHub for issue tracking. To continue following the resolution of this issues, please visit: https://github.com/zendframework/zf2/issues/2574

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