Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
\Drupal\Core\Theme\ThemeInitialization declares $moduleHandler dynamically.
Declare it as a property of the class.
Comment | File | Size | Author |
---|---|---|---|
#2 | 2914595-2.patch | 600 bytes | _gradient_ |
Comments
Comment #2
_gradient_ CreditAttribution: _gradient_ as a volunteer and at AnyforSoft commentedComment #3
penyaskitoRTBC if passes.
There is no need for adding tests in this issue, as it's a task and not a bug.
Thanks!
Comment #4
alexpottPotentially there might be an issue if someone is accessing this property from outside the ThemeInitialization service. As it currently is the equivalent of a public property. But if so they really are not doing it right. Since the module handler is a service they really should be getting it injected. So let's go forward with this in 8.5.x. This was just a mistake introduced in #2389735: Core and base theme CSS files in libraries override theme CSS files with the same name
Committed 5a8337c and pushed to 8.5.x. Thanks!