-
Notifications
You must be signed in to change notification settings - Fork 2.5k
fileprg and array merge recursive #4974
Comments
Not 100% if it's the same issue - but I remember running into something similar - my solution was to use Again, it might not be the same issue, I will double check when I get a chance tomorrow |
Take a look at ArrayUtils::merge() |
I'm having trouble determining if this is something that needs to be fixed in the framework, or that can be fixed in userland using |
Collections with more than one element are a big problem without this fix. |
Did some proving tests: 2DivisionsByZero/zf2@14aaa1f |
@weierophinney Did some proving tests: 2DivisionsByZero/zf2@14aaa1f |
Previous commit "Testcase for successive file uploads" is required too in |
@dpommeranz Could you take a look on the test? https://github.com/2DivisionsByZero/zf2/tree/fileprg-tests |
@dpommeranz Can you submit d05f1a7 as a PR against this repository, please? and/or @2DivisionsByZero you could submit your tests as a PR. Either way, the work is being done -- a PR is the correct way to get it into the repository. |
Conflicts: library/Zend/Mvc/Controller/Plugin/FilePostRedirectGet.php
Fixed with #5244 |
In HandlePostRequest method of Zend/Mvc/Controller/Plugin/FilePostRedirectGet.php, you're using array_merge_recursive to compile file upload data, and field input data in order to validate the form. But in some cases it can causes issue, i'm using Doctrine2 and object are created thanks to an hydrator based on collection of my form
Here is my files array
And my input array
array_merge_recursive on those arrays produce this array :
As you can see it created a new key 225 (so for doctrine, a new object)
I fixed it Extending the class and using the function to merge arrays, but i'm sure there is a better way to do it :
The text was updated successfully, but these errors were encountered: