Problem/Motivation
When another module decorates the Messenger service, eca's drush commands will not be available. Constructor argument mismatch exception is observed in debug log.
Could not instantiate Drupal\eca\Drush\Commands\EcaCommands: Drupal\eca\Service\ExportRecipe::__construct(): Argument #5 ($messenger) must be of type Drupal\Core\Messenger\Messenger, Drupal\eca_helper\Decorate\Messenger given, called in /Users/starlight/Sites/obelix2026merge/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 261
Steps to reproduce
- Install both ECA and the contrib module ECA Helper
- Run command
drush -vvv eca
- Observe the exception.
- Observe that eca namespace commands are missing from the returned command list
Proposed resolution
\Drupal\eca\Service\ExportRecipe::__construct() should typehint MessengerInterface instead of Messenger.
Remaining tasks
User interface changes
No changes
API changes
No changes
Data model changes
No changes
Comments
Comment #3
starlight-sparkleComment #4
starlight-sparkleFixed typos in issue summary.
Comment #6
jurgenhaasGreat finding and thanks for contributing the fix, @starlight-sparkle