ThemeFuse / Unyson

A WordPress framework that facilitates the development of WP themes
http://unyson.io
923 stars 219 forks source link

PHP 8.1 sizes generate issue with array merge #4289

Open AmentoTech opened 1 year ago

AmentoTech commented 1 year ago

Hello @ViorelEremia

I hope you are doing well

We are a theme developer and have been working with Unyson and its demo content importer for a couple of years. PHP 7.4 is deprecated on many servers. Our many customers, facing issues with demo content import. This is not a big issue but stopping our customers to import demo content. We just got fixed that by adding a line of code. If you could add that fix quickly that would be much appreciated

8 1

This is fix https://github.com/ThemeFuse/Unyson-Backups-Extension/commit/3f7665b7650fb0f7e219bd037045cee408edb370 ext-8 1

Replace that line :

$state['processed_sizes'] = array_merge($state['processed_sizes'], $meta['sizes']);

with below

if(!empty($state['processed_sizes']) && !empty($meta['sizes'])){
    $state['processed_sizes'] = array_merge($state['processed_sizes'], $meta['sizes']);
}

Looking forward to fixing that asap, that would be much appreciated

Thank you