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, 11 months ago
Updated 25 November 2023, 7 months 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.69.0 2024