- Issue created by @longwave
- Status changed to Needs review
11 months ago 6:24pm 19 January 2024 - Status changed to Needs work
11 months ago 7:36pm 19 January 2024 - π¬π§United Kingdom longwave UK
This also fails in ServiceProviderTestServiceProvider:
// Make sure a cached service can be also called in a service provider. // https://www.drupal.org/project/drupal/issues/2363351 /** @var \Drupal\Core\Extension\ModuleHandlerInterface $module_handler */ $module_handler = $container->get('module_handler');
The module handler ultimately depends on the cache factory, but because of the way the service locator is injected we end up with this error:
1) Drupal\KernelTests\Core\DrupalKernel\DrupalKernelTest::testCompileDIC Symfony\Component\DependencyInjection\Exception\RuntimeException: Constructing service "cache_factory" from a parent definition is not supported at build time.
As we need cacheable services accessible at container build time, not sure there is a way around this; we might have to inject the entire container instead.
- Merge request !6797Resolve #3415938 "Cachefactory inject container" β (Closed) created by longwave
- Status changed to Needs review
10 months ago 10:10pm 27 February 2024 - π¬π§United Kingdom longwave UK
ChainedFastBackendFactory follows the same pattern. Have not figured out how to work around the issue in #5, so the simplest solution is just to continue injecting the container into both factory services.
- Status changed to RTBC
10 months ago 5:53am 28 February 2024 - π³π±Netherlands spokje
I also don't see a way around injecting the whole container in both services.
Tests are green, code changes make sense and are minimal, don't think this needs a CR?
RTBC.
- π¬π§United Kingdom longwave UK
Yeah no CR is needed, no API is changing here really, we are just copying the method and property directly into the class.
- First commit to issue fork.
- Status changed to Fixed
10 months ago 10:27am 28 February 2024 - πΊπ¦Ukraine taraskorpach Lutsk πΊπ¦
catch β credited taraskorpach β .
- π¬π§United Kingdom catch
Committed/pushed to 11.x and cherry-picked to 10.3.x, thanks! Also can't see any need for a CR here.
Automatically closed - issue fixed for 2 weeks with no activity.