-
Notifications
You must be signed in to change notification settings - Fork 50
Input fallback_value option limitation/feature suggestion #70
Comments
A |
Considering the dozens of hours spent with the most recent releases to build a test matrix for the current combination of options, I beg to differ. Any new options introduced at this point need to be very carefully evaluated, as they add more permutations to the test matrix: we already are testing something like 32 combinations of options; adding another would double that to 64. |
In that case, maybe we could remove the "fallback if invalid" behaviour in 3.0? |
I think the name is not correct for this behavior I am thinking about |
The behavior can be do with very little effort by extending Personally I prefer don't add implementations are not required by the Input interface and just provide stable and tested implementations. Anyway, feel free to send a PR with the desired implementation and I'll reconsider my opinion if the implementation is simple and bugfree Hint: zend-inputfilter/test/InputTest.php Lines 581 to 587 in a05fa0b
zend-inputfilter/test/BaseInputFilterTest.php Lines 473 to 506 in a05fa0b
|
@Maks3w what do you think if we make this default behavior in ZF3? This would be BC but for 3.0 this is acceptable. |
@svycka +1 I use same behavior especially in grid controllers |
@svycka I don't consider replace a behavior an option. Instead I suggest send a PR where two behaviors could be used (one at time) probably setting a second parameter to setFallbackValue with an optional second argument where the default value is the current behavior. |
Closed due inactivity |
Ran into this limitation today made me pull my hair out. Fallback values which just work in the empty case would be very much appreciated. W.r.t. complexity in the combination of flags: I think the solution is to split the Input class to multiple classes. Some combinations of options don't make sense or are very niche and you avoid that entirely that way. |
Would be nice if possible to use fallback value on optional fields only when input not set. Current behavior is when input is not set or validation fails, but I would like to fail validation if input is not valid and use fallback only when input is not set at all. With current behavior is impossible to check if data is invalid.
example:
This is not possible at the moment, but very important scenario for me. I think after #25 when required option works as 'is set' and not as 'not empty' this would make more sense. no?
I think having fallback on invalid data is bad idea. Also if data should be modified somehow to be valid there is filters for this.
The text was updated successfully, but these errors were encountered: