Hi folks.
In my company we are having a weird problem. We have a Form with a Select element with 4 value options. It is properly validated (an InArrayValidator is included) when we test it in any development machine with Linux, but one of us is using Windows. In his machine invalid values pass as they were valid.
If we remove the element from the InputFilter (asuming no other validations will occur) the InArrayValidation keeps working on any Linux mahine, but on Windows is even more weird. When we call $form->getData() that element has been removed, as if it wasen't added to the form in the first place.
We are getting out of ideas. Is there any incompatibility with windows? We have checked Ubuntu + PHP5.5 + ZF2.3 -> Works as expected Ubuntu + PHP5.4 + ZF2.3 -> Works as expected
Windows 7 + PHP5.4 + ZF2.3 -> Weird errors. |
I am only guessing, but do you have a case mismatch somewhere? On Fri, Jun 20, 2014 at 2:21 PM, Alejandro Celaya <[hidden email]> wrote:
|
Can you post a gist with a baseline test - everything necessary to reproduce but no extra stuff?
On Fri, Jun 20, 2014 at 9:49 AM, Gary Hockin <[hidden email]> wrote:
|
Sorry, I sent this message some minutes ago but missed to include the list address *** Thanks! -- El 20/06/2014 16:08, "Phillip Harrington" <[hidden email]> escribió:
Can you post a gist with a baseline test - everything necessary to reproduce but no extra stuff? |
Hello. Sorry for the delay. I was preparing a small example removing all the elements not related and simplifying it as much as possible. There is no factories either, as the dependency injection doesn't look to be the problem.
This is the gist https://gist.github.com/acelaya/78970ed8f428edc8dda8 This is the case. We have a Collection element which is not required. It is composed by a Fieldset, which in turn is composed by a Select element and a Text element.
The Select in the fieldset has 4 possible values that should be validated by the InArryValidator included on it. Just as the example is right now, on Windows, if the input data is something like this
The form is valid, but when you call getData() the languages are missing (????)
Otherwise, if I use TheOtherInputFilter instead of TheInputFilter, which creates a Zend\InputFilter\Input for the language, then it is present when calling getData() as expected, but in this case the problem is that any value is valid for the language, as if it didn't have an InArrayValidator.
Both examples work as expected in other Linux machines. Let me know if someone is able to reproduce it. In the meantime I'm trying to reproduce it in another Windows machine, but I need to prepare the environment.
Thank you very much! 2014-06-20 16:10 GMT+02:00 Alejandro Celaya <[hidden email]>:
Alejandro Celaya Alastrué
|
Hello again. I finally got the time to test this myself in a Windows machine and it's definitely happening. I fixed two typos in the previous gist (https://gist.github.com/acelaya/78970ed8f428edc8dda8) and used that example.
The error I explained in the last message is produced only on Windows platforms. For no reason, one of the Fieldset values is missing when calling $form->getData(), but only on Windows (WTF!). I tested that example in Windows 7 + PHP 5.5 + ZF 2.3 (with xampp) -> the error is produced. Then I tested the same example (the exact same file in the exact same project) in an Ubuntu 14.04 + PHP 5.5 + ZF 2.3 -> everything worked as expected.
I will try to dig into the Zend Framework code because this seems like a bug. Don't know if it's a PHP bug on WIndows, a xampp bug or a Zend Framework bug, but the behavior is clearly inconsistent.
Any help will be very apreciated. If anyone more used to work on Windows could do the test I would be very gratefull. Best regards!
2014-06-22 12:37 GMT+02:00 Alejandro Celaya <[hidden email]>:
Alejandro Celaya Alastrué
|
Hi guys. I finally found the problem. Our form is much more complex than the example I sent you. The problem was that "someone" defined twice the CollectionInputFilter for the descriptions. In the second one the language (the property that was being removed after validation) wasn't defined in the InputFilter assigned to that CollectionInputFilter, but it was in the first one. On Linux that seemed to work, but on Windows that language disappeared. It's an inconsistent behavior, but the bug was on our code.
Thank you all and sorry for the "spam" of the last days. 2014-08-03 11:17 GMT+02:00 Alejandro Celaya <[hidden email]>:
Alejandro Celaya Alastrué
|
Free forum by Nabble | Edit this page |