Compatibility with PHP 8.1 mb_strlen

Created on 19 January 2023, almost 2 years ago
Updated 13 July 2023, over 1 year ago

Problem/Motivation

PHP 8.1 has deprecated passing null as parameters.

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: 120)
_menu_link_weight_get_options('admin', '', 'menu_link_content:532477e8-5659-485e-8dcc-dde2d2c0b6d2', NULL) (Line: 194)
menu_link_weight_menu_link_content_element_process(Array, Object, Array)
call_user_func_array('menu_link_weight_menu_link_content_element_process', Array) (Line: 1007)
Drupal\Core\Form\FormBuilder->doBuildForm('menu_link_content_menu_link_content_form', Array, Object) (Line: 1070)
Drupal\Core\Form\FormBuilder->doBuildForm('menu_link_content_menu_link_content_form', Array, Object) (Line: 574)
Drupal\Core\Form\FormBuilder->processForm('menu_link_content_menu_link_content_form', Array, Object) (Line: 320)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 48)
Drupal\Core\Entity\EntityFormBuilder->getForm(Object) (Line: 28)
Drupal\menu_link_content\Controller\MenuController->addLink(Object)

Steps to reproduce

  • Add a menu link to any menu.
πŸ› Bug report
Status

Closed: duplicate

Version

1.0

Component

Code

Created by

πŸ‡ΈπŸ‡ͺSweden aramean

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

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