Yoast / Yoast-SEO-for-Magento2

Yoast SEO for Magento 2
Other
70 stars 29 forks source link

array_merge warning #59

Closed Frankhendriks closed 6 years ago

Frankhendriks commented 6 years ago

Hi,

I get no errors when installing the plugin but when after install i want to go to catalog/products and try to edit a product i get this:

Exception #0 (Exception): Warning: array_merge(): Argument #1 is not an array in /data/www/homint.nl/public_html/app/code/MaxServ/YoastSeo/Ui/Catalog/DataProvider/Product/Form/Modifier/YoastSeo.php on line 181

Do any of you know what it might be ? Running magento 2.1.8, but it also does this in M2.1.9

vincenthornikx commented 6 years ago

Hi @Frankhendriks, could you check that the yoast_facebook_image and yoast_twitter_image attributes are present in your attribute set?

In an aside, it looks like you're using version 1.0.7 of the module. You may consider upgrading to the latest version as there have been some bugfixes and minor enhancements.

Frankhendriks commented 6 years ago

Hey @vincenthornikx , I removed the old version, and installed v1.1.1 It still doesn't work and i don't see yoast_facebook_image and yoast_twitter_image attributes in my attribute sets.

I still get the same error but now on a different line:

1 exception(s): Exception #0 (Exception): Warning: array_merge(): Argument #1 is not an array in /data/www/homint.nl/public_html/app/code/MaxServ/YoastSeo/Ui/Catalog/DataProvider/Product/Form/Modifier/YoastSeo.php on line 235

WesleyVestjens commented 6 years ago

Hi @vincenthornikx, to me it seems very desirable to perform an is_array check before trying to merge the arrays. Even if the attribute is it not present for whatever reason (it might even not be in that specific attribute set on purpose), this should not break the entire page.

vincenthornikx commented 6 years ago

confirmed, will be fixed in the next release where we will be using arraymanager to handle this for us.

vincenthornikx commented 6 years ago

issue has been fixed in version 2.0.0