-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: [Validation] DotArrayFilter returns incorrect array when numeric index array is passed #8414
Conversation
Thank you for this PR! But some GitHub Action checks are not successful. See
Also we expect all code changes or bug-fixes to be accompanied by one or more tests added to our test suite to prove the code works. |
I've provided a simplified unit test that fails when using array_merge_recursive but succeeds with the use of array_replace_recursive. Don't know that it covers every use case so if a more seasoned developer could consider the ramifications I would be appreciative. There appears to be a similar issue in Laravel. |
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.
The first commit is completely removed. So squash the commits if you can.
The use of array_merge_recursive rewrites numerically indexed values when attempting to retrieve validated data. Use of the array_replace_recursive function preserves their ordering. Unit test demonstrates the failure of array_merge_recursive's use rather than array_replace_recursive
The GPG sign is missing. Please sign again. |
There's no GPG associated with my account. |
How did you sign the commits before squashing? We cannot merge commits without signing. Thank you. |
I made the changes directly on the github platform, but I couldn't squash the commits unless I did it locally. |
I'll close this and open a new pull request without the squash. |
@grimpirate Okay, no problem. |
Description
The use of array_merge_recursive rewrites numerically indexed values when attempting to retrieve validated data. Use of the array_merge_recursive_distinct function preserves their ordering. For an in-depth explanation and test harness.
Checklist: