This repository has been archived by the owner on Jan 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 50
InputFilter not populating/using FallbackValue for Input #10
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The patch modifies the logic of BaseInputFilter to ensure that if an input supports fallback values (is an instanceof Input), and has fallback value, then that fallback value will be considered when determining validity of the input. In other words, if the value is missing from the data set, the fallback value is assumed. It also adds a test to ensure that if the value *is* passed but empty, the fallback value is used for that input.
@disasterdrop I've verified the issue, and:
Please check the tests to make sure they're testing the behavior you need, and we'll get a release out with the fixes. |
When approved, we'll also release a 2.4 LTS version with the fix. |
I've reviewed and it looks good to me. Feel free to merge. |
@disasterdrop Why did you close this? We haven't merged the patch yet! |
@weierophinney |
weierophinney
added a commit
that referenced
this pull request
Aug 3, 2015
weierophinney
added a commit
that referenced
this pull request
Aug 3, 2015
&& $hasFallback | ||
) { | ||
$input->setValue($input->getFallbackValue()); | ||
continue; |
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.
Should the input to be append to validInputs collection?
weierophinney
added a commit
to weierophinney/zend-inputfilter
that referenced
this pull request
Sep 8, 2015
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After updating from Version 2.3.5 to the newest Version i'm running into following error.
I'm creating an new InputFilter creating the Inputs in __construct() like this:
Then i'm calling
With Version 2.3.5 it's worked as expected. Populating the Fallback Value and not throwing an Error. But with 2.5.* instead of filling the Page Input with the Fallback Value it's empty and the Filter is not valid.