Deprecated function: strlen(): Passing null to parameter #1 ($string) of type string is deprecated

Created on 29 March 2024, 10 months ago
Updated 22 July 2024, 6 months ago

Problem/Motivation

When visiting the crop type listing (/admin/config/media/crop), for every crop type without a description the following warning is shown:

Deprecated function: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\Component\Utility\Unicode::validateUtf8() (line 395 of core/lib/Drupal/Component/Utility/Unicode.php).

Steps to reproduce

This deprecation only shows when using PHP 8.1+.

Proposed resolution

Pass an empty string to Xss::filterAdmin() if $entity->description is NULL.

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium dieterholvoet Brussels

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