- Issue created by @hkirsman
- Status changed to Postponed: needs info
over 1 year ago 11:48am 19 February 2023 This is not the configuration system. The dependency injection container does not allow circular object dependencies. Can you explain a little more what you are asking?
- 🇪🇪Estonia hkirsman
We are using this https://www.drupal.org/docs/drupal-apis/configuration-api/configuration-... → to override the theme logo. But to find the active theme, we need "theme.manager" service which we have included from here https://git.drupalcode.org/project/high_contrast/-/blob/8.x-1.x/high_con... Now clearing cache gives this "Circular reference detected for service" error. To solve it, we are planning to remove the dependency injection and use the service directly:
$theme = $this->themeManager->getActiveTheme()->getName();
-->
$theme = \Drupal::theme()->getActiveTheme()->getName();
MR here https://git.drupalcode.org/project/high_contrast/-/merge_requests/4
- 🇳🇿New Zealand quietone
Shorten title, moved full message to the Issue Summary.
What is “now” in “Up until now”? Did a specific Drupal release change a behavior?
- 🇪🇪Estonia hkirsman
No, I mean I've never had problems with dependency injections in D8 or D9. First time I learned about this problem was when users started to complain when using High Contrast module. Then again I have not used config.factory.override before.
- Status changed to Closed: outdated
over 1 year ago 3:13pm 16 June 2023 I am closing this as there have been no replies. Reopen it if needed.