When adding a new translation: Deprecated function: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in Drupal\form_mode_manager_theme_switcher\Theme\FormModeThemeNegociator->isApplicable()

Created on 7 November 2024, 5 months ago

Problem/Motivation

Deprecated function: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in Drupal\form_mode_manager_theme_switcher\Theme\FormModeThemeNegociator->isApplicable() (line 93 of modules/contrib/form_mode_manager/modules/form_mode_theme_switcher/src/Theme/FormModeThemeNegociator.php).

Steps to reproduce

When adding a new translation (using Content Translation support Content Translation support RTBC patch, not though as the content translation overview works), the following error message shows on the form:

Proposed resolution

Add a check on $route->getDefault('_entity_form') inside the str_replace in case the route default is not set (for example, when adding a translation) and $route->getDefault('_entity_form') returns NULL which causes the deprecation error above.

Remaining tasks

Add check

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇬🇧United Kingdom andreastkdf

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

Comments & Activities

Production build 0.71.5 2024