Deprecated function: file_exists(): Passing null to parameter #1 ($filename) of type string is deprecated in image_resize_filter_get_images()

Created on 7 August 2023, over 1 year ago
Updated 25 November 2023, about 1 year ago

Problem/Motivation

After upgrading the PHP version to 8.1 I have been getting similar error messages to https://www.drupal.org/project/image_resize_filter/issues/3375251 🐛 is_file(): Passing null to parameter #1 ($filename) of type string is deprecated in modules/contrib/image_resize_filter/image_resize_filter.module Needs review , for the Drupal 7 version of the module.

Deprecated function: file_exists(): Passing null to parameter #1 ($filename) of type string is deprecated in image_resize_filter_get_images() (line 349 of /var/www/html/docroot/profiles/d2/modules/contrib/image_resize_filter/image_resize_filter.module).
Deprecated function: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in image_resize_filter_get_images() (line 349 of /var/www/html/docroot/profiles/d2/modules/contrib/image_resize_filter/image_resize_filter.module).

Steps to reproduce

Upgrade PHP version to 8.1 then will you be able to produce the error.

Proposed resolution

Check if the value is not null first.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom colinstillwell

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024