-
-
Notifications
You must be signed in to change notification settings - Fork 436
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 ArgumentCountError: array_merge_recursive() #1402
Conversation
fix ArgumentCountError: array_merge_recursive() does not accept unknown named parameters
Using array_values in this case is not good solution. It causes notices and warnings just like this: Notice: Undefined index: labels in /app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 347 Another solution/workaround of this case is needed. |
@@ -343,7 +343,7 @@ public function filterImageInGallery($product, $image) | |||
} | |||
|
|||
if (!isset($this->_productImageFilters[$product->getId()])) { | |||
$mapping = call_user_func_array("array_merge_recursive", $product->getChildAttributeLabelMapping()); | |||
$mapping = call_user_func_array("array_merge_recursive", array_values($product->getChildAttributeLabelMapping())); | |||
$filters = array_unique($mapping['labels']); |
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.
Notice: Undefined index: labels in /app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 347
I tested it with a product from the sample data. '$product->getChildAttributeLabelMapping()':
The only difference is in the first level array keys as you see.
Therefore, Iam not sure the issues you describe @S0FTWEX are related to this fix. |
We tested this fix and it works successfully without any notices and warnings. |
fix ArgumentCountError: array_merge_recursive() does not accept unknown
named parameters
Description (*)
On a Product containing swatches (with Demo Data: /men/shirts/plaid-cotton-shirt-473.html ) on PHP8
appears the following error:
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)