strtr(): Passing null to parameter #1 ($string) of type string is deprecated in media_theme_suggestions_media()

Created on 19 October 2023, about 1 year ago
Updated 25 January 2024, 10 months ago

Problem/Motivation

When using PHP 8.1 the following warnings are displayed/logged.

Deprecated function: strtr(): Passing null to parameter #1 ($string) of type string is deprecated in media_theme_suggestions_media() (line 113 of /var/www/html/core/modules/media/media.module)

Steps to reproduce

open status report for a sub site in a multisite project

Proposed resolution

Prevent passing in NULL by converting it to string.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Media 

Last updated about 2 hours ago

Created by

🇧🇾Belarus postyly Minsk

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024