PHP 8.1 EasyBreadcrumbBuilder::normalizeText deprecation

Created on 10 January 2022, over 2 years ago
Updated 27 June 2024, 2 months ago

Problem/Motivation

During the build of the breacrumb, NULL values can be passed to EasyBreadcrumbBuilder::normalizeText, from EasyBreadcrumbBuilder::getTitleString for example, which triggers a deprecation in PHP 8.1:
Deprecated function: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in Drupal\easy_breadcrumb\EasyBreadcrumbBuilder->normalizeText() (line 888 of modules/contrib/easy_breadcrumb/src/EasyBreadcrumbBuilder.php).

Proposed resolution

We should return early an empty string if there is nothing to normalize and update the method documentation.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇨🇭Switzerland Aerzas

Live updates comments and jobs are added and updated live.
  • PHP 8.1

    The issue particularly affects sites running on PHP version 8.1.0 or later.

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