-
-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Form implements InputFilterProviderInterface - validators fix #44
Comments
Does this fix mean, that I have to copy all filters from method Originally posted by @megapixar at zendframework/zend-form#82 (comment) |
@akrabat Could you have a look on it, please? Originally posted by @michalbundyra at zendframework/zend-form#82 (comment) |
@froschdesign @akrabat rebased Originally posted by @michalbundyra at zendframework/zend-form#82 (comment) |
Is this a BC break? Originally posted by @akrabat at zendframework/zend-form#82 (comment) |
i.e. if I add an email element and specify an additional validator that the length must be greater than 5, does this PR mean that the EmailAddress validator is no longer added? Originally posted by @akrabat at zendframework/zend-form#82 (comment) |
@akrabat I've created an example here: https://gist.github.com/webimpress/e08e5a8928cbc3fec249fdc723705652 So, without my fix we have got:
and with my fix we have:
Basically there is something wrong. I've decided to do this way, so override default validators. In my application always I'm using fieldset and always when I get field from fieldset (from a form) validators specified in Please note, I haven't changed any tests, so I haven't break (tested) functionality. IMHO if you implement form with Originally posted by @michalbundyra at zendframework/zend-form#82 (comment) |
This repository has been moved to laminas/laminas-form. If you feel that this patch is still relevant, please re-open against that repository, and reference this issue. To re-open, we suggest the following workflow:
Originally posted by @weierophinney at zendframework/zend-form#82 (comment) |
@froschdesign I understand the motivation for zendframework/zend-form#82 but I do not agree that's a good solution. So I'm inclined to close this as |
Go for it. The way is always open to create a new issue report. |
When Form implements
InputFilterProviderInterface
and validators for an element are defined in methodgetInputFilterSpecification
, only these validators should be added to theInputFilter
of the Form for the element.The same behavior should be for Fieldsets and it works fine. Basically, validators defined in
getInputFilterSpecification
should override default validators of the Element.Originally posted by @michalbundyra at zendframework/zend-form#82
The text was updated successfully, but these errors were encountered: