The method \Drupal::moduleHandler()->getName($module) has been deprecated

Created on 4 July 2024, 4 months ago
Updated 18 July 2024, 4 months ago

Summary problem/ motivation

I got the following deprecation notifications in Drupal 10.3.0:
User deprecated function: Drupal\Core\Extension\ModuleHandler::getName() is deprecated in drupal:10.3.0 and is removed from drupal:12.0.0. Use \Drupal\Core\Extension\ModuleExtensionList::getName($module) instead. See https://www.drupal.org/node/3310017 in Drupal\Core\Extension\ModuleHandler->getName() (line 728 of core/lib/Drupal/Core/Extension/ModuleHandler.php).

Proposed resolution

Remove all instances of \Drupal\Core\Extension\ModuleExtensionList::getName and replace them with \Drupal::service('extension.list.module')->getName

๐Ÿ“Œ Task
Status

Needs review

Version

1.1

Component

Code

Created by

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024