Remove getImplementations compatibility layer

Created on 7 August 2023, over 1 year ago
Updated 2 October 2023, about 1 year ago

Problem/Motivation

Call to deprecated method getImplementations() of class Drupal\Core\Extension\ModuleHandlerInterface. Deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. Instead you should use ModuleHandlerInterface::invokeAllWith() for hook invocations or you should use ModuleHandlerInterface::hasImplementations() to determine if hooks implementations exist.

File: mailsystem\src\Form\AdminForm.php

Steps to reproduce

Scan the module using upgrade status for Drupal 10 compatibility.

📌 Task
Status

Active

Version

4.0

Component

Code

Created by

🇮🇳India gawalin

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

Comments & Activities

  • Issue created by @gawalin
  • First commit to issue fork.
  • Status changed to Closed: works as designed over 1 year ago
  • 🇺🇸United States rymcveigh

    I'm marking this as a duplicate because it is resolved in this module's 8.x-4.x branch. It checks to see if the invokeAllWith method exists and then calls it. But, to support Drupal 8, they must leave the getImplementations function in place.

    if (method_exists($this->moduleHandler, 'invokeAllWith')) {
          $this->moduleHandler->invokeAllWith('mail', function (callable $hook, string $module) use (&$list) {
            $list[$module] = $this->moduleHandler->getName($module);
          });
        }
        else {
          foreach ($this->moduleHandler->getImplementations('mail') as $module) {
            $list[$module] = $this->moduleHandler->getName($module);
          }
        }
    
  • Status changed to Active over 1 year ago
  • 🇨🇭Switzerland berdir Switzerland

    Correct. But what we can do here is remove that and require 9.4.

  • 🇨🇭Switzerland berdir Switzerland
Production build 0.71.5 2024