PHP8 compatibility

Created on 2 December 2022, about 2 years ago
Updated 20 June 2024, 6 months ago

Problem/Motivation

Getting error message:

Deprecated function: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\Component\Utility\Unicode::truncate() (line 314 of core/lib/Drupal/Component/Utility/Unicode.php).
Drupal\Component\Utility\Unicode::truncate(NULL, 30, 1, ) (Line: 127)
_menu_link_weight_get_options('test1', '', 'menu_link_content:14384e36-7312-4bb3-a918-6cb0c2cb3262', NULL) (Line: 194)
menu_link_weight_menu_link_content_element_process(Array, Object, Array)

Steps to reproduce

ENV: Drupal 9.4.x, PHP8.1
Under any menu, and click the "Add link" button

Proposed resolution

The mb_strlen() function in Unicode::truncate cannot accept NULL value.
See https://php.watch/versions/8.1/internal-func-non-nullable-null-deprecation

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Component

Code

Created by

🇨🇦Canada francismak

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024