Error: Call to undefined method Drupal\Core\Extension\ModuleHandler::hasImplementations()

Created on 18 April 2023, over 1 year ago
Updated 4 May 2023, over 1 year ago

Problem/Motivation

I followed the Drupal 9 to Drupal 10 upgrade instructions at https://www.drupal.org/docs/upgrading-drupal/upgrading-from-drupal-8-or-... β†’ .

The upgrade was not without issues. For example, I had to remove a number of packages from composer.json that were preventing the upgrade, and ended up completely removing the vendor directory and let "composer upgrade" rebuild it. No changes were made to webform during this process, however. Eventually the upgrade ran successfully and we have:

"drupal/core-composer-scaffold": "^10",
"drupal/core-project-message": "^10",
"drupal/core-recommended": "^10"

Next step of the upgrade process is to update the database. However this fails, using either update.php or "drush updatedb". The error message is as follows:

The website encountered an unexpected error. Please try again later.
Error: Call to undefined method Drupal\Core\Extension\ModuleHandler::hasImplementations() in webform_library_info_alter() (line 52 of modules/contrib/webform/includes/webform.libraries.inc).

If I comment out lines 52 to 54 and re-run the update, I get another error:

The website encountered an unexpected error. Please try again later.
Error: Call to undefined method Drupal\Core\Extension\ModuleHandler::invokeAllWith() in Drupal\webform\WebformLibrariesManager->initLibraries() (line 471 of modules/contrib/webform/src/WebformLibrariesManager.php).

I upgraded to 6.2.x-dev but the error message is still the same.

πŸ’¬ Support request
Status

Closed: won't fix

Version

6.2

Component

Code

Created by

πŸ‡ΈπŸ‡¦Saudi Arabia ishore

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

Comments & Activities

  • Issue created by @ishore
  • Can you confirm the version of 6.1 you are (or were?) testing? There isn't a function call on line 471 of src/WebformLibrariesManager.php in 6.1.4 6.1.x or 6.2.x.

  • πŸ‡ΈπŸ‡¦Saudi Arabia ishore

    Hi, yes it was 6.2@beta. I then upgraded to 6.2.x-dev in an attempt to fix the error.

    Actually, having gone to 6-2.x-dev, the first error message is the same and the second errors on line 475 rather than 471:

    The website encountered an unexpected error. Please try again later.
    Error: Call to undefined method Drupal\Core\Extension\ModuleHandler::invokeAllWith() in Drupal\webform\WebformLibrariesManager->initLibraries() (line 475 of modules/contrib/webform/src/WebformLibrariesManager.php).

  • Status changed to Postponed: needs info over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY

    What version of Drupal are you running when these errors are triggered?

  • Status changed to Active over 1 year ago
  • πŸ‡ΈπŸ‡¦Saudi Arabia ishore

    This is just after upgrading to version 10 of Drupal from version 9, when I am trying to update the database.

  • πŸ‡ΈπŸ‡¦Saudi Arabia ishore

    The more I investigate, the more this appears to be an issue with the Composer upgrade process rather than Webform.

  • πŸ‡§πŸ‡ͺBelgium lobsterr

    I can also confirm the issue with the latest 6.2 version and Drupal core 1.0.8, I my case all update hooks passed successfully

  • Status changed to Closed: won't fix over 1 year ago
  • πŸ‡§πŸ‡ͺBelgium lobsterr

    it looks like the issue in the core package and not in webform module. ModuleHandler missing code for hasImplementations, but at the same time it is in repo and never has been removed.

    I figure out, for some reason Drupal core alpha1 was installed together with core-recommended and yes "hasImplementations" is missing there.
    So, just install a correct core version.

  • πŸ‡§πŸ‡·Brazil wfraga

    I also got the same error, but with this comment https://www.drupal.org/project/webform/issues/3354912#comment-15031319 πŸ’¬ Error: Call to undefined method Drupal\Core\Extension\ModuleHandler::hasImplementations() Closed: won't fix I realized that my issue was only the PHP version that was set on 8.0.28.

    With this PHP version, drupal/core-recommended will get the drupal/core at version 10.0.0-alpha1, which has issues with webform in lasted versions.

    So I basically had to upgrade my PHP to 8.1 and reinstall drupal/core-composer-scaffold, drupal/core-recommended, which got the correct version of drupal/core 10.0.9 and now webform is working properly.

Production build 0.71.5 2024