D10: Call to undefined method Drupal\Core\Extension\ModuleHandler::getImplementations()

Created on 30 November 2022, almost 2 years ago
Updated 14 June 2023, over 1 year ago

Problem/Motivation

(Reporting this on behalf of a colleague...)

Apparently there's a problem in D10 with 2.0.1 whereby we end up with the error:

Error: Call to undefined method Drupal\Core\Extension\ModuleHandler::getImplementations() in Drupal\clamav\Scanner->isScannable() (line 120 of /var/www/html/docroot/modules/contrib/clamav/src/Scanner.php). 

Steps to reproduce

Try to upload a file in D10's UI with clamav enabled.

Proposed resolution

https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Extension...

...confirms that ModuleHandler::getImplementations is:

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.

See: https://www.drupal.org/node/3000490

Remaining tasks

tbc

User interface changes

tbc

API changes

tbc

Data model changes

tbc

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇬🇧United Kingdom mcdruid 🇬🇧🇪🇺

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.

  • 🇦🇺Australia alex.skrypnyk Melbourne

    @mcdruid

    Can we please have a release for this functionality as D10 sites are broken without this fix. Thank you!

  • 🇸🇮Slovenia KlemenDEV

    How can we access 2.0.2-rc1 in order to use this module on D10?

  • 🇬🇧United Kingdom Belazoth

    I noticed that when trying to apply the patch from #9 onto release 2.0.1 you also needed to apply the patch from #5 first otherwise patch from #9 would not apply. So i have combined them into one patch to make it simpler for people until release 2.0.2-rc1 is released

  • 🇬🇧United Kingdom Belazoth

    @klemendev if you are using composer you can assess it by running the following.

    composer require 'drupal/clamav:^2.0.2@RC'

Production build 0.71.5 2024