Deprecated function: explode(): Passing null to parameter #2 ($string) of type string is deprecated

Created on 1 December 2022, almost 2 years ago
Updated 16 March 2023, over 1 year ago

Problem/Motivation

Drupal 9.4.8, PHP 8.1

Deprecated function: explode(): Passing null to parameter #2 ($string) of type string is deprecated in Drupal\language_switcher_enhanced\PLugin\Block\LanguageSwitcherEnhancedBlock->changeLinksAreTranslated() (line 355 of modules/contrib/language_switcher_enhanced/src/Plugin/Block/LanguageSwitcherEnhancedBlock.php).

Steps to reproduce

  1. Install Module
  2. Navigate to /404

Proposed resolution

Check to make sure the $route_name value isn't null.

$route_name_parts = explode('.', $route_name ?? '');

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇮🇳India Manikandan Era

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