Fatal error with ‘scan folder for new images’ with 3.57
-
After upgrading to 3.57, I’m seeing errors when updating a gallery with the ‘Scan folder for new images button’. A partial stack trace:
[12-Jan-2024 15:56:01 UTC] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /www/www.example.com/wordpress/wp-content/plugins/nextgen-gallery/src/DataStorage/Manager.php:2292 Stack trace: #0 /www/www.example.com/wordpress/wp-content/plugins/nextgen-gallery/src/Legacy/admin/functions.php(206): Imagely\NGG\DataStorage\Manager->generate_image_size() #1 /www/www.example.com/wordpress/wp-content/plugins/nextgen-gallery/src/Legacy/admin/functions.php(304): nggAdmin::rotate_image()
That line 2292 looks like this:
$image->meta_data[ $size ] = $size_meta;
From debug logging I added, it appears that sometimes,
$image->meta_data
is an empty string at this point, rather than the array it should be, so it seems that the property is not properly initialized in some cases. Adding the following just before line 2292 seems to fix the problem:if ( empty( $image->meta_data ) || ! is_array( $image->meta_data ) ) {
$image->meta_data = []; }Regards,
Martijn.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Fatal error with ‘scan folder for new images’ with 3.57’ is closed to new replies.