Found a Bug on GoogleCards most recent extension
Found a Bug on GoogleCards most recent extension,
This would show up when on a configured product, that had all simple produces set to be offline, and the configured product would not be viewable.
main.ERROR: Warning: array_keys() expects parameter 1 to be array, null given in ... public_html/app/code/WeltPixel/GoogleCards/Block/GoogleCards.php on line 354 [] []
-
Official comment
Hi everyone! Our dev team has already been made aware of this issue for Configurable Products related to the Rich Snippets extension. A fix has already been developed and it'll be included in the next version of the extension, as well as all Pearl Theme Packs.
We hope to have the new release out within a few days, and apart from the regular fixes, improvements, and optimizations, we'll also be confirming compatibility with the newly released Magento 2.4.2! We announce all new Product Releases via Newsletter, so make sure you subscribe on weltpixel.com if you haven't done so yet! :)
Comment actions -
I had to workaround it, by checking if the array was set, and creating empty array if it wasn't.... I'm not the best PHP programmer by any means... so my correction may have been sub-optimal.
$usedproductAttributes = $product->getData('_cache_instance_used_product_attributes');
if (isset($usedproductAttributes)) {
$productAttributes = array_keys($usedproductAttributes);
} else {
$productAttributes = [];
} -
Hi,
we are using Pearl Theme 1.10.1, Magento 2.4.1, php 7.4.14 and we have the same error and it is probably caused by php 7.4 because we do not have this problem on php 7.3.23.Jason Becker's solution doesn't work.
Does anyone have the right solution? Weltpixel support has no solution?
So far, the only solution is to disable WeltPixel_GoogleCards.
Regards
Eduard
-
Hi,
I also have Magento on php 7.3.24 and there the patch from Jason Becker doesn't work for me, this patch works for me (row 354 inWeltPixel/GoogleCards/Block/GoogleCards.php):
if (is_array ($ product)) {
$ productAttributes = array_keys ($ product-> getData ('_ cache_instance_used_product_attributes'));
}Try it.
Regards
Eduard
Please sign in to leave a comment.
Comments
6 comments