Issue Bug Closed

#102029Deprecation notice when using CE "Related pages" (menu_related_pages)

Ramón Schlosser 09/25/23, 08:55 updated 07/09/24, 15:19

Description

When using the CE “Related pages” (menu_related_pages) and having pages in the list with no keyword selected the following exception occurs:

PHP Runtime Deprecation Notice: preg_split(): Passing null to parameter #2 ($subject) of type string is deprecated in /var/www/html/vendor/typo3/cms-frontend/Classes/ContentObject/ContentObjectRenderer.php line 4760

The problem seems to be that when creating ne pages the keywords are `NULL`. A simple “Null coalescing operator” in /typo3/cms-frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php:828 should fix the issue:

$kw = trim($this->parent_cObj->keywords($value_rec[$kfieldSrc] ?? ''));

Reviews 3