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

Fixed form collections with nested fieldsets that implements InputfilterProviderInterface #7426

Merged
merged 3 commits into from
May 4, 2015

Conversation

meNeither
Copy link
Contributor

Here is a fix for the usage of collections and the InputFilterProviderInterface.

The problem was: If you're using getInputFilterSpecification() for your fieldsets and embed them in a collection, the input filters were never added to the form, resulting in errors when using setValidationGroup() or the inability to bind data to nested fieldsets.

The fix also ensures that infinite nested collections with InputFilterProviderInterface-fieldsets are working correctly.

$inputFilter->getInputFilter()->add($input, $filterName);
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it can be copied into separate private method to reduce repetitive addition block code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. I added addInputsToCollectionInputFilter.

@@ -274,59 +274,6 @@ public function testReuseMatchedParametersWithSegmentController()
$this->assertEquals(303, $prgResultRoute->getStatusCode());
}

public function testFieldsetAmountInFormEqualsFieldsetsInInputFilter()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I deleted this test, because now a CollectionInputFilter is used for collections and there is no need for checking the same amount of fieldsets and InputFilters. Please correct me, if I am wrong.

@weierophinney weierophinney added this to the 2.4.1 milestone May 4, 2015
weierophinney added a commit that referenced this pull request May 4, 2015
Fixed form collections with nested fieldsets that implements InputfilterProviderInterface
weierophinney added a commit that referenced this pull request May 4, 2015
@weierophinney weierophinney merged commit 87d1516 into zendframework:master May 4, 2015
weierophinney added a commit that referenced this pull request May 4, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants