d1m007 / gshoppingflux

PrestaShop Google Shopping Flux Module
100 stars 61 forks source link

Fix combinations check #105

Closed getdatakick closed 1 month ago

getdatakick commented 2 years ago

In thirty bees 1.4.0, method Product::getAttributesResume returns empty array for products without combinations. Previously, this method returned false.

Unfortunately that is braking change that affects this module. There is a check

is_array($attributesResume) > 0

that now returns returns true even for products without combinations. This in turn results in products without combinations to be omitted from output file.

The check is quite strange, I suspect the original code used to be

count($attributesResume) > 0

but was changed because it raised warnings in PHP7. I propose to change the check simply to to

$attributesResume

Related to thirtybees/thirtybees#1467