myparcelnl / prestashop

PrestaShop module to integrate with MyParcel NL and BE
https://developer.myparcel.nl/nl/documentatie/11.prestashop.html
10 stars 5 forks source link

[BETA]: (beta-2) TypeError in PdkDeliveryOptionsMigration #244

Closed mariuszsienkiewicz closed 5 months ago

mariuszsienkiewicz commented 6 months ago

Version check

PrestaShop version

8.1.5

PHP version

8.1

What went wrong?

https://github.com/myparcelnl/prestashop/blob/5d0da006167dd2a6840073118679eecc00edbc7f/src/Migration/Pdk/PdkDeliveryOptionsMigration.php#L125-L128

// lets say that $row['delivery_settings'] is null, then json_decode('', true) => NULL
$deliverySettings = json_decode($row['delivery_settings'] ?? '', true); 

// array_merge(NULL, []) => Uncaught TypeError: array_merge(): Argument #1 must be of type array, null given
$newDeliveryOptions = $this->transformDeliveryOptions(array_merge($deliverySettings, $extraOptions)); 

// same with $extraOptions

Reproduction steps

none

Relevant log output

No response

Additional context

No response

mariuszsienkiewicz commented 6 months ago

Okay I see that you are already working on it in #241.

EdieLemoine commented 5 months ago

Resolved in #241 (expect a new release very soon, hopefully this week 🤞🏼)