[PHP 8] md5(): Passing null to parameter #1 ($string) of type string is deprecated

Created on 7 February 2023, almost 2 years ago

Problem/Motivation

Deprecated function: md5(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\entity_reference_media\Plugin\Field\FieldFormatter\EntityReferenceMediaFormatter->viewElements() (Zeile 219 in /var/www/html/web/modules/contrib/entity_reference_media/src/Plugin/Field/FieldFormatter/EntityReferenceMediaFormatter.php)

Steps to reproduce

Not sure how exactly to reproduce the error. It just appeared in log messages while PHP 8.1 is used for the website.

Proposed resolution

Add a check if MD5 function arguments are not empty.

Remaining tasks

Open a merge request.

User interface changes

none.

API changes

none.

Data model changes

none.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇦🇹Austria granik Vienna

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

Comments & Activities

Production build 0.71.5 2024