Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jan 8, 2020. It is now read-only.

Update collection recursive extract and populating nested fieldsets#5502

Closed
ltouro wants to merge 1 commit into
zendframework:masterfrom
ltouro:patch-1
Closed

Update collection recursive extract and populating nested fieldsets#5502
ltouro wants to merge 1 commit into
zendframework:masterfrom
ltouro:patch-1

Conversation

@ltouro

@ltouro ltouro commented Nov 19, 2013

Copy link
Copy Markdown
Contributor

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

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

Copy link
Copy Markdown
Contributor

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 #5495

@ltouro

ltouro commented Nov 19, 2013

Copy link
Copy Markdown
Contributor Author

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

@fabiocarneiro

Copy link
Copy Markdown
Contributor

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

@fabiocarneiro

Copy link
Copy Markdown
Contributor

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

@fabiocarneiro

Copy link
Copy Markdown
Contributor

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

@Maks3w

Maks3w commented Feb 23, 2014

Copy link
Copy Markdown
Member

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 added a commit that referenced this pull request Mar 3, 2014
Update collection recursive extract and populating nested fieldsets

Conflicts:
	library/Zend/Form/Element/Collection.php
weierophinney added a commit that referenced this pull request Mar 3, 2014
- Unit test passes now, meaning we can close both issues.
weierophinney added a commit that referenced this pull request Mar 3, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants