Problem/Motivation
During updates on one of our sites, updating this module to 3.0.1 caused some issues in combination with chi-tek/drupal-code-generator version 2.5.1
We're getting the following error:
Error: Class 'DrupalCodeGenerator\Command\BaseGenerator' not found in /web/modules/contrib/hook_event_dispatcher/src/Generators/LegacyEventGenerator.php on line 14 #0 phar:///usr/local/bin/drush/vendor/composer/ClassLoader.php(444): include()
Steps to reproduce
Install version 3.0.1 in combination with chi-tek/drupal-code-generator 2.5.1
Proposed resolution
- Remove deprecated LegacyEventGenerator or at least make it compatible with all supported versions.
- Possibly restrict the drupal-code-generator version in composer.json?
Remaining tasks
Create patch
| Comment | File | Size | Author |
|---|
Issue fork hook_event_dispatcher-3266861
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
randalv commentedAdding a patch that removes the legacy component for now as a quick fix, this is probably not the correct solution but I don't have the time to find one that would work right now.
Comment #3
randalv commentedMy apologies, the patch was corrupted by a previous change.
Comment #4
thomas.lobjoie commentedThanks for this patch, just a quick note that this only apply when using Drush 11. If you are still using Drush 10, then an other error comes up. Which I opened aticket for here: https://www.drupal.org/project/hook_event_dispatcher/issues/3282632
Comment #5
el7cosmosDrush should only pick one of the two services, can you see if running
drush cache:rebuildsolves the problemComment #7
marios anagnostopoulos commentedI also did not have time to look into it, so I just re-rolled the quick fix of #3 for 3.3.1
Comment #9
dieterholvoet commentedI found a better solution, removing the legacy service definition in the service provider if the class does not exist. I pushed it to the MR.
Comment #11
mxr576@DieterHolvoet you have not opened an MR from 3266861 - easy mistake - therefore Drupal CI checked the latest uploaded patch, which failed, so it changed back the status to "Needs work".
Comment #13
dieterholvoet commentedRight, thanks for the heads up.
Comment #14
mxr576Comment #16
el7cosmos