PHP error on update to 1.2.3 related to new disable image styles feature

Created on 17 July 2024, 4 months ago
Updated 19 July 2024, 4 months ago

I tried updating to 1.2.3 and was getting a 500 error on any page that is using webp fallback images:

TypeError: array_filter(): Argument #1 ($array) must be of type array, null given in array_filter() (line 153 of /code/web/modules/contrib/wpf/src/ImageFactory.php).

Which refers to this line of code in /wpf/src/ImageFactory.php:

$this->disabledStyles = array_filter($settings->get('styles.disabled'));

To get things working, I simply had to go to the WPF config page (/admin/config/media/wpf) and save it.

As far as a an actual fix to the module code, I assume the code just needs to check if $settings->get('styles.disabled') is empty and if so, set it to an empty array so null isn't getting passed to the array_filter function.

My site is running on PHP 8.3.

πŸ› Bug report
Status

Needs work

Version

1.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States davedg629

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024