- Issue created by @almador
- 🇬🇪Georgia almador
Today I noticed that clearing caches shows this error:
The website encountered an unexpected error. Try again later. Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException: Circular reference detected for service "class_resolver", path: "string_translation -> string_translator.locale.lookup -> config.factory -> config.typed -> class_resolver -> entity_type.manager". in Drupal\Component\DependencyInjection\Container->get() (line 149 of core/lib/Drupal/Component/DependencyInjection/Container.php). Drupal\Component\DependencyInjection\Container->get('class_resolver', 1) (Line: 438) Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 239) Drupal\Component\DependencyInjection\Container->createService(Array, 'entity_type.manager') (Line: 179) Drupal\Component\DependencyInjection\Container->get('entity_type.manager') (Line: 315) Drupal::entityTypeManager() (Line: 218) Drupal\Core\Session\AccountProxy->loadUserEntity('185') (Line: 77) Drupal\Core\Session\AccountProxy->getAccount() (Line: 121) Drupal\Core\Session\AccountProxy->hasPermission('access devel information') (Line: 200) backtrace_error_handler(16384, 'Calling Drupal\Core\DependencyInjection\ClassResolver::__construct without the $container argument is deprecated in drupal:10.3.0 and it will be required in drupal:11.0.0. See https://www.drupal.org/node/3419963', '/home/user/public_html/core/lib/Drupal/Core/DependencyInjection/ClassResolver.php', 23) trigger_error('Calling Drupal\Core\DependencyInjection\ClassResolver::__construct without the $container argument is deprecated in drupal:10.3.0 and it will be required in drupal:11.0.0. See https://www.drupal.org/node/3419963', 16384) (Line: 23) Drupal\Core\DependencyInjection\ClassResolver->__construct() (Line: 261) Drupal\Component\DependencyInjection\Container->createService(Array, 'class_resolver') (Line: 179) Drupal\Component\DependencyInjection\Container->get('class_resolver', 1) (Line: 438) Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 239) Drupal\Component\DependencyInjection\Container->createService(Array, 'config.typed') (Line: 179) Drupal\Component\DependencyInjection\Container->get('config.typed', 1) (Line: 438) Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 239) Drupal\Component\DependencyInjection\Container->createService(Array, 'config.factory') (Line: 179) Drupal\Component\DependencyInjection\Container->get('config.factory', 1) (Line: 438) Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 239) Drupal\Component\DependencyInjection\Container->createService(Array, 'string_translator.locale.lookup') (Line: 179) Drupal\Component\DependencyInjection\Container->get('string_translator.locale.lookup', 1) (Line: 438) Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 275) Drupal\Component\DependencyInjection\Container->createService(Array, 'string_translation') (Line: 179) Drupal\Component\DependencyInjection\Container->get('string_translation') (Line: 197) Drupal::service('string_translation') (Line: 104) Drupal\Core\EventSubscriber\FinalExceptionSubscriber->getStringTranslation() (Line: 71) Drupal\Core\EventSubscriber\FinalExceptionSubscriber->t('The website encountered an unexpected error. Try again later.') (Line: 129) Drupal\Core\EventSubscriber\FinalExceptionSubscriber->onException(Object, 'kernel.exception', Object) call_user_func(Array, Object, 'kernel.exception', Object) (Line: 111) Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.exception') (Line: 239) Symfony\Component\HttpKernel\HttpKernel->handleThrowable(Object, Object, 1) (Line: 91) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53) Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28) Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 106) Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85) Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36) Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51) Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 741) Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Any suggestions?
- 🇩🇪Germany Grevil
I synchronized the "class_resolver" service with the core "class_resolver" service in 📌 Automated Drupal 11 compatibility fixes for layout_builder_st Needs review , which fixed the issue!
- 🇬🇪Georgia almador
Hi, @grevil!
Maybe you could provide the final patch to solve the error?
Or prepare the more detailed instructions?
- 🇩🇪Germany Grevil
Hey @almador!
You could download the plain diff of https://git.drupalcode.org/project/layout_builder_st/-/merge_requests/16..., which is : https://git.drupalcode.org/project/layout_builder_st/-/merge_requests/16...
- 🇬🇪Georgia almador
@liam Yes, I tried with the plain diff from:
https://git.drupalcode.org/project/layout_builder_st/-/merge_requests/16...But now I received the error:
PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function Drupal\layout_builder_st\DependencyInjection\DecoratedClassResolver::__construct(), 0 passed in /app/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php on line 261 and exactly 1 expected in /app/public_html/modules/contrib/layout_builder_st/src/DependencyInjection/DecoratedClassResolver.php:17Which seems to be mentioned by @grevil here:
https://www.drupal.org/project/layout_builder_st/issues/3431600#comment-... 📌 Automated Drupal 11 compatibility fixes for layout_builder_st Needs review - 🇬🇪Georgia almador
curl https://git.drupalcode.org/project/layout_builder_st/-/merge_requests/16.patch | patch -p1 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 32327 0 32327 0 0 44344 0 --:--:-- --:--:-- --:--:-- 44466 patching file layout_builder_st.info.yml Hunk #1 succeeded at 2 with fuzz 1. patching file layout_builder_st.services.yml patching file src/Plugin/SectionStorage/OverridesSectionStorage.php Hunk #2 FAILED at 22. 1 out of 2 hunks FAILED -- saving rejects to file src/Plugin/SectionStorage/OverridesSectionStorage.php.rej patching file layout_builder_st.install patching file src/Plugin/SectionStorage/OverridesSectionStorage.php Hunk #1 FAILED at 22. 1 out of 1 hunk FAILED -- saving rejects to file src/Plugin/SectionStorage/OverridesSectionStorage.php.rej patching file layout_builder_st.services.yml patching file src/DependencyInjection/ClassResolver.php patching file src/DependencyInjection/DecoratedClassResolver.php patching file src/ElementManager.php patching file layout_builder_st.services.yml patching file layout_builder_st.services.yml patching file src/Plugin/SectionStorage/OverridesSectionStorage.php Hunk #2 FAILED at 23. 1 out of 2 hunks FAILED -- saving rejects to file src/Plugin/SectionStorage/OverridesSectionStorage.php.rej patching file src/Plugin/SectionStorage/OverridesSectionStorage.php Hunk #1 FAILED at 24. 1 out of 1 hunk FAILED -- saving rejects to file src/Plugin/SectionStorage/OverridesSectionStorage.php.rej patching file layout_builder_st.services.yml patching file src/DependencyInjection/DecoratedClassResolver.php patching file layout_builder_st.services.yml patching file src/DependencyInjection/DecoratedClassResolver.php patching file .gitlab-ci.yml patching file tests/src/Functional/Jsonapi/LayoutBuilderEntityViewDisplayTest.php patching file tests/src/Functional/Jsonapi/LayoutBuilderEntityViewDisplayTest.php patching file tests/src/Functional/Rest/LayoutRestTestBase.php patching file layout_builder_st.info.yml Hunk #1 FAILED at 5. 1 out of 1 hunk FAILED -- saving rejects to file layout_builder_st.info.yml.rej patching file layout_builder_st.services.yml patching file tests/src/Functional/Jsonapi/LayoutBuilderEntityViewDisplayTest.php patching file tests/src/Functional/LayoutBuilderTranslationTest.php patching file tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayJsonBasicAuthTest.php patching file tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayResourceTestBase.php patching file tests/src/Functional/Rest/LayoutBuilderEntityViewDisplayXmlBasicAuthTest.php patching file tests/src/Functional/Rest/LayoutRestTestBase.php patching file tests/src/Functional/Rest/OverrideSectionsTest.php patching file tests/src/FunctionalJavascript/InlineBlockTranslationTest.php patching file tests/src/FunctionalJavascript/ModeratedTranslationTest.php patching file tests/src/FunctionalJavascript/TranslationTest.php
- 🇨🇦Canada Liam Morland Ontario, CA 🇨🇦
I suggest you try the fix in 📌 Automated Drupal 11 compatibility fixes for layout_builder_st Needs review . If that breaks something, report it there.
- 🇨🇦Canada joseph.olstad
Yes I had to fix this in
📌 Automated Drupal 11 compatibility fixes for layout_builder_st Needs reviewPostponing this issue on 3431600
- 🇬🇪Georgia almador
Yes, I can confirm that the patch provided by @joseph.olstad resolves the problem.
Again, thank you for doing a lot to make it work!