Original Issue: https://api.github.com/repos/zendframework/zendframework/issues/7156
User: @epoleacov
Created On: 2015-01-25T22:22:49Z
Updated At: 2015-10-19T21:10:08Z
Body
When nested object bonded to form with related collection elements, this collection elements has just empty objects.
So for example if we run next test:
final object used for assertion should have original data ($_product->getObject()->getPrice() == 200), but it has just NULL instead.
Main cause of that is because when values extracted from collection is just takes extracted values, but forget about objects what was used in extraction which should be saved inside of collection under "object" property, which on his side used later for filling collection target elements on populateValues();
User: @iprdp
Created On: 2015-04-20T18:15:00Z
Updated At: 2015-04-20T18:15:00Z
Body
I have worked around this bug by creating the targetElementInstance during extract(). Not sure if this is good enough for a fix.
Comment
User: @adamlundrigan
Created On: 2015-10-19T21:10:08Z
Updated At: 2015-10-19T21:10:08Z
Body
@epoleacov could you provide an example showing the behaviour you are seeing? I'm not having any luck reproducing what you're trying to explain
This issue has been moved from the
zendframework
repository as part of the bug migration program as outlined here - http://framework.zend.com/blog/2016-04-11-issue-closures.htmlOriginal Issue: https://api.github.com/repos/zendframework/zendframework/issues/7156 User: @epoleacov Created On: 2015-01-25T22:22:49Z Updated At: 2015-10-19T21:10:08Z Body When nested object bonded to form with related collection elements, this collection elements has just empty objects. So for example if we run next test:
final object used for assertion should have original data ($_product->getObject()->getPrice() == 200), but it has just NULL instead.
Main cause of that is because when values extracted from collection is just takes extracted values, but forget about objects what was used in extraction which should be saved inside of collection under "object" property, which on his side used later for filling collection target elements on populateValues();
Next is line where values extracted, but objects are lost: https://github.com/zendframework/zf2/blob/b1e9f3bb3ce9cdc925139d98672af40f6b0f33d7/library/Zend/Form/Element/Collection.php#L528
Comment
User: @iprdp Created On: 2015-04-20T18:15:00Z Updated At: 2015-04-20T18:15:00Z Body I have worked around this bug by creating the targetElementInstance during extract(). Not sure if this is good enough for a fix.
Comment
User: @adamlundrigan Created On: 2015-10-19T21:10:08Z Updated At: 2015-10-19T21:10:08Z Body @epoleacov could you provide an example showing the behaviour you are seeing? I'm not having any luck reproducing what you're trying to explain