PHP8.1 drupal core utility deprecations

Created on 3 October 2022, over 2 years ago
Updated 17 January 2024, about 1 year ago

Problem/Motivation

Deprecated function: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\Component\Utility\Unicode::validateUtf8() (line 478 of core/lib/Drupal/Component/Utility/Unicode.php).

Deprecated function: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in Drupal\Component\Utility\Xss::filter() (line 69 of core/lib/Drupal/Component/Utility/Xss.php).

Steps to reproduce

Proposed resolution

Created patch to handle the NULL parameter in utility componenets.

🐛 Bug report
Status

Closed: outdated

Version

11.0 🔥

Component
Other 

Last updated about 16 hours ago

Created by

🇮🇳India piyusha_pokharana

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.

  • 🇺🇸United States smustgrave

    If still a valid bug please reopen updating issue summary with steps to reproduce per #4

    Thanks.

  • 🇲🇦Morocco h_kac

    we had the same error when we upgraded to php8.1, after we investigated we found that we implemented hook_views_view_field where we changed $variables['output'], instead of having a string we had an array, and that explains why we had the error.
    After fix it, everything works as expected.

Production build 0.71.5 2024