-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Extract and populate values for nested fieldsets in Collection elements #5093
Conversation
if ($fieldset->allowObjectBinding($object)) { | ||
$fieldset->setObject($object); | ||
$values[$name] = $fieldset->extract(); | ||
}else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a space before else.
Change makes sense to me. Could you add a test please ? :) |
Actually this issue is not related with input filters. The fix should just populate values on nested elements and fieldsets those collection has and also bind objects to fieldsets. |
$fieldset->setObject($object); | ||
$values[$name] = $fieldset->extract(); | ||
} else { | ||
foreach($fieldset->fieldsets as $childFieldset){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add space after foreach before and after open/close parenthesis.
Extract and populate values for nested fieldsets in Collection elements
This new code block in Collection.php breaks my application. I'm using ZF2 with Doctrine 2 and before the change, all my values in nested elements were populated. Removing the new code block leads to a working application again. |
Same here. Ive added a failing test for that. #5495 . But if you notice its necessary, since without it, the nested fieldsets does not have objects. Something is wrong with that code, but i dont know what. |
This commit modifies the IndexController to test the really needed behavior: $form->bind() The problem: $form->bind() method was throwing an unespected exception. This problem was introduced in ZF 2.2.5 through zendframework/zendframework#5093 So the fatest solution would be downgrade to ZF 2.2.4, then lets make it :D
If collection element has nested fieldsets, objects are never bound and values are never extracted or populated.
This should fix it