Deprecated function: mb_strlen(): Passing null to parameter #1

Created on 7 September 2023, over 1 year ago

If you are on php 8.x, you may see this error: Deprecated function: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\Component\Utility\Unicode::truncate() (line 313 of core/lib/Drupal/Component/Utility/Unicode.php).

This happens if null is passed as the first parameter to Unicode::truncate();.

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇨🇦Canada dshields

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

Comments & Activities

  • Issue created by @dshields
  • Status changed to Needs review over 1 year ago
  • 🇨🇦Canada dshields

    This patch checks to make sure values are set before passing them to Unicode:truncate();

Production build 0.71.5 2024