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.

Issue fork crop-3436966

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

DieterHolvoet created an issue. See original summary.

dieterholvoet’s picture

Issue summary: View changes
Status: Active » Needs review

dieterholvoet’s picture

Issue summary: View changes
dieterholvoet’s picture

Issue summary: View changes
tart0’s picture

Status: Needs review » Reviewed & tested by the community

Patch tested, this fix the issue, thanks !

phenaproxima’s picture

phenaproxima’s picture

Status: Reviewed & tested by the community » Fixed

Looks good to me. Merged into 8.x-2.x.

Status: Fixed » Closed (fixed)

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