Problem/Motivation
The website encountered an unexpected error. Try again later.
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "Drupal\classy\Hook\ClassyHooks". in Drupal\Component\DependencyInjection\Container->get() (line 159 of core/lib/Drupal/Component/DependencyInjection/Container.php).
\Drupal\Core\DrupalKernel::discoverServiceProviders skippes themes.
Steps to reproduce
Update to release 2.0.1 and open the page.
Proposed resolution
Remove services.yml and use the class directly.
Remaining tasks
-
User interface changes
-
API changes
-
Data model changes
-
Issue fork classy-3600782
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
tobiasbComment #4
tobiasbComment #5
tobiasbComment #6
smustgrave commentedJust tried replicating and not getting any error.
Also would expect the tests to be failing if it caused fatal errors?
Comment #7
tobiasbThe tests are running with D11, and the hooks in classy.theme are not called. Main problem is only in d10.
With d10:
Comment #8
tobiasbOh this would also break in Drupal core < v11.3. because the support for theme oop hooks was added there https://www.drupal.org/node/3551652.
Comment #9
smustgrave commentedCan we use a deprecation helper vs deleting the service?
Comment #10
smustgrave commentedSomething like that? Thoughts?
Comment #11
tobiasbThe file is never loaded. I created also a https://www.drupal.org/project/rector/issues/3600784.
\Drupal\Core\DrupalKernel::discoverServiceProvidersonly supports modules.Comment #12
solideogloria commentedThis causes a fatal error site-wide wherever the theme is applied. Bumping to Critical.
Comment #13
solideogloria commentedLooks good to me.
Comment #14
maheshv commentedWe tested this in our local environment using Drupal 10.6.10, and it is working fine. We are not encountering any issues related to this.
Comment #15
smustgrave commentedWill take a look tomorrow but not overly a fan of reverting this to just calling the class
Comment #16
smustgrave commentedComment #18
smustgrave commentedThanks everyone just did a new tag