Closed svycka closed 9 years ago
@Maks3w do you think this should be fixed or not? This holding me from updating. @weierophinney what do you think? It seems that your fix for another bug introduced this.
I just want to note that this was reverting behavior back to where it was in 2.2.4 and before. See zendframework/zf2#6264
So:
version | result |
---|---|
<= 2.2.4 | raw values get passed as context |
>= 2.2.5 && <= 2.5.1 | values extracted from inputs get passed as context |
>= 2.5.2 | raw values get passed as context |
Even more fun :) then maybe time to take final decision on this and add some tests.
@svycka I don't understand your example. Your code does not use any of getXValue method. What method is giving you troubles?
@Maks3w problem is not the getXValue methods but the context passed to validators. It varies between versions. Example shows that when I have input filter with two inputs and I provide data for one input, as context in validators I don't get both values. But with older versions of zend-inputfilter there would be both in context.
//simplified example
$inputFilter = ['A', 'B']; // A, B inputs
$inputFilter->setData(['B' => null]);
then when validating B validators as context gets ['B' => null]
when in older versions it would be ['A' => null, 'B' => null]
Also @marcuswinkler noted that this change happened not the first time.
Ahm. Seems I found the same issue today while reviewing the code. #24
@svycka Could you review #24
Before 2.5.2 context values was all inputs added to inputfilter but 2.5.2 changed this and now returns raw values passed to inputFilter. I Think this should be and is correct behavior, but unfortunately now it is BC. This should be at least mentioned in release notes or fixed.
example:
output with versions =<2.5.1
output with versions =>2.5.2