Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Update collection recursive extract and populating nested fieldsets #5502

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
4 participants
Contributor

ltouro commented Nov 19, 2013

Appending the child object to the child fieldset instead the parent one. Setting values of child fieldset as the correct extract

@ltouro ltouro Update collection recursive extract and populating nested fieldsets
Appending the child object to the child fieldset instead the parent one. Setting values of child fieldset as the correct extract
9097711
Contributor

fabiocarneiro commented Nov 19, 2013

Thats much better than current code. At least it doesnt try to set an array to a fieldset. But it is still giving me errors. Also this test isnt passing zendframework#5495

Contributor

ltouro commented Nov 19, 2013

For some reason, when dealing with nested fieldsets, you must to add a new Hydrator to then on the "mainFieldset" after adding it (even if in the target Fieldset you already add one):

on "mainFieldset":

    $this->add(array(
        'type' => 'Zend\Form\Element\Collection',
        'name' => 'specifications',
        'options' => array(
            'label' => 'Option specifications',
            'count' => 1,
            'allow_add' => true,
            'allow_remove' => true,
            'should_create_template' => true,
            'target_element' => new SpecificationFieldset($objectManager),
        ),
        'attributes' => array(
            'class' => 'nested-fieldset',
            'id' => 'opt_specifications',
        ),
    ));
    $this->get('specifications')->setHydrator(new DoctrineHydrator($objectManager));

on target Fieldset

$this->setHydrator(new DoctrineHydrator($objectManager))->setObject(new \Bundle\Entity\Specification());

Had to do that to solve my issue with nested fieldsets

Contributor

fabiocarneiro commented Nov 19, 2013

That is very weird. @thestanislav, can you take a look?

@thestanislav thestanislav referenced this pull request in fabiocarneiro/FhcsFormTest Nov 19, 2013

Merged

Fixes #2

Contributor

fabiocarneiro commented Nov 21, 2013

I think this really should be merged asap. My nested forms are trying to bind arrays to fieldsets, which is obviouly wrong.

Contributor

fabiocarneiro commented Dec 2, 2013

@thestanislav Are you still on this? Can i talk to you in #zftalk? What is your nickname?

Member

Maks3w commented Feb 23, 2014

Please add test cases

@weierophinney weierophinney added this to the 2.2.6 milestone Mar 3, 2014

@weierophinney weierophinney self-assigned this Mar 3, 2014

@weierophinney weierophinney added a commit that referenced this pull request Mar 3, 2014

@weierophinney weierophinney Merge pull request #5502 from ltouro/patch-1
Update collection recursive extract and populating nested fieldsets

Conflicts:
	library/Zend/Form/Element/Collection.php
307e48f

@weierophinney weierophinney added a commit that referenced this pull request Mar 3, 2014

@weierophinney weierophinney [#5502] Added test from #5495
- Unit test passes now, meaning we can close both issues.
efb0b4c

@weierophinney weierophinney added a commit that referenced this pull request Mar 3, 2014

@weierophinney weierophinney Merge branch 'hotfix/5502' into develop
Forward port #5502
f7caf71

@guenterh guenterh referenced this pull request in swissbib/libadmin Nov 24, 2015

Closed

Sortierung in View nach Bearbeitung einer Institution #4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment