Error: Interface "Drupal\webprofiler\DrupalDataCollectorInterface" not found

Created on 18 May 2023, over 1 year ago
Updated 25 May 2023, over 1 year ago

Problem/Motivation

When Drupal is building a list of services on Drupal 9.x and trying to initialize the webprofiler.eca_ui, I got an error:

 [error]  Error: Interface "Drupal\webprofiler\DrupalDataCollectorInterface" not found in include() (line 15 of /var/www/html/docroot/modules/contrib/eca/modules/ui/src/DataCollector/EcaDataCollector.php) #0 /var/www/html/vendor/composer/ClassLoader.php(582): include()

Steps to reproduce

1. Install phpstorm_metadata module.
2. Try to build the list of services via:

drush phpstorm-metadata:generate

3. See the error:

$ drush  phpstorm-metadata:generate
 [notice] Generating PHPStorm Metadata file
 [error]  Error: Interface "Drupal\webprofiler\DrupalDataCollectorInterface" not found in include() (line 15 of /var/www/html/docroot/modules/contrib/eca/modules/ui/src/DataCollector/EcaDataCollector.php) #0 /var/www/html/vendor/composer/ClassLoader.php(582): include()
#1 /var/www/html/vendor/composer/ClassLoader.php(433): Composer\Autoload\{closure}('/var/www/html/d...')
#2 /var/www/html/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php(259): Composer\Autoload\ClassLoader->loadClass('Drupal\\eca_ui\\D...')
#3 /var/www/html/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService(Array, 'webprofiler.eca...')
#4 /var/www/html/docroot/modules/contrib/phpstorm_metadata/src/Service/MetadataGenerator.php(78): Drupal\Component\DependencyInjection\Container->get('webprofiler.eca...')
#5 /var/www/html/docroot/modules/contrib/phpstorm_metadata/src/Service/MetadataGenerator.php(47): Drupal\phpstorm_metadata\Service\MetadataGenerator->getServiceMap()
#6 /var/www/html/docroot/modules/contrib/phpstorm_metadata/src/Commands/PhpstormMetadataDrushCommands.php(43): Drupal\phpstorm_metadata\Service\MetadataGenerator->generate()
#7 [internal function]: Drupal\phpstorm_metadata\Commands\PhpstormMetadataDrushCommands->generateMetadata(Array)

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

💬 Support request
Status

Closed: works as designed

Version

1.1

Component

Code

Created by

🇦🇲Armenia murz Yerevan, Armenia

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

Comments & Activities

  • Issue created by @murz
  • 🇩🇪Germany jurgenhaas Gottmadingen

    Hmm, I think this is more a bug with the phpstorm_metadata module. The service webprofiler.eca_ui is never used until the webprofiler data collector plugin EcaDataCollector is being initialized. But that won't ever happen until the webprofiler module is being installed and enabled.

    The phpstorm_metadata module seems to blindly initialize that class without reason, and that's what's causing that error.

  • Status changed to Closed: works as designed over 1 year ago
  • 🇩🇪Germany jurgenhaas Gottmadingen
Production build 0.71.5 2024