TypeError: mb_strlen ($string) must be of type string, array given at line 314 on Unicode.php

Created on 18 April 2023, over 1 year ago
Updated 19 April 2023, over 1 year ago

Problem/Motivation

TypeError: mb_strlen(): Argument #1 ($string) must be of type string, array given in mb_strlen() (line 314 of /shared/httpd/sall/web/core/lib/Drupal/Component/Utility/Unicode.php)
#0 /shared/httpd/sall/web/core/lib/Drupal/Component/Utility/Unicode.php(314): mb_strlen(Array)

Steps to reproduce

While:
- I am trying to translate menu
- To create a new content type

That error produced.

Proposed resolution

I trying to add the code below before line 314 and the core code if (mb_strlen($string) <= $max_length) { and it seems that it works as expected.

if(!is_string($string)) {
if(is_object($string)) {
$string = $string->getUntranslatedString();
}
else {
$string = "test";
}
}

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Closed: works as designed

Version

9.4

Component
Menu systemΒ  β†’

Last updated 1 day ago

Created by

πŸ‡¬πŸ‡·Greece ggkikas

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