-
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
Fix "each()" function call on potentially invalid data #8446
Conversation
@giacmir Hi, could you please provide an example where |
@ishakhsuvarov It happens on an edge case if you call
|
@giacmir |
@ishakhsuvarov I tried, and it says "Thank you for signing the CLA" and sends me back to github but nothing happens.. |
@giacmir Thank you |
@giacmir that you for this PR. Your PR merged to develop branch |
In some cases the
$attributesData
variable can befalse
at this point of execution. If this happenscount($attributesData)
returns 1 and then the code inside theif
is evaluated. But then the call toeach
fails with errorVariable passed to each() is not an array or object in /var/www/html/vendor/magento/module-catalog/Model/ResourceModel/AbstractResource.php
It is necessary to check that
$attributesData
is actually an array before attempt tocount
its content.