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.

Comments

granik created an issue. See original summary.

granik’s picture

Assigned: Unassigned » dejan0
Status: Active » Needs review

Added a MR, @dejan0, should be checked.

  • granik committed 1b0051c6 on 1.0.x
    Issue #3339910: php8 fix md5 null argument notice
    
dejan0’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.