
Problem/Motivation
Some contrib modules (and probably custom) have classes that depend on the class ModuleHandler, instead of the ModuleHandlerInterface.
This causes problems with hux.
PHP Fatal error: Uncaught TypeError: ***::__construct(): Argument #1 ($module_handler) must be of type Drupal\Core\Extension\ModuleHandler, Drupal\hux\HuxModuleHandler given, called in /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 and defined in ***
In most cases, these modules are simply doing it wrong and should be patched to use the interface.
All that we need to do is to tell people what to do.
Steps to reproduce
Proposed resolution
Easiest solution:
Just leave this issue as a place that people will hopefully find if they search the error message.
Second easiest solution:
Add something on the module page or in README.md.
More effort:
Detect services that depend on the ModuleHandler class.
I don't think this is worth it..
Comments
Comment #2
dpiFor a while I was keeping a tab on contrib issue queues, listening for these issues and making them all consistent, since I put together the same Hux work for Hook Event Dispatcher.
You can see many of them referenced by #3277301: Adapt to centralised hook dispatcher in Drupal 9.4.
Im sure theres enough google juice at this point, if not for that issue then any of the referenced issues.