-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Collection walk method bug fix when specific callback function #5742
Conversation
$results[$id] = call_user_func_array($cb, $args); | ||
//@codingStandardsIgnoreStart | ||
$results[$id] = call_user_func_array($cb, $params); | ||
//@codingStandardsIgnoreEnd |
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.
What needs to be ignored here?
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.
Nothing, I was just getting a warning that you should not use "call_user_func_array". I removed these coding standard ignores
…function #5742 - covered fix with unit test
@jalogut Thank you for the contribution |
[mpi] MC-29755: X-Magento-Tags header too large
When a specific class is set as callback on a collection->walk, it works only for the first item in the collection. The problem is that array_unshift modifies directly the value of $args adding the $item object at the beginning. That works well for the first iteration but after that $args grow and grow keeping previous $item objects from previous iterations.
How to test:
Just try an a collection->walk with more than 1 item. Only the callback for the first element is successful.