Issue #3564915: Fix ContainerNotInitializedException during D11 container compilation

Summary

Fixes the remaining gap in CacheBase::deleteMultiple() where ContainerNotInitializedException can still occur on Drupal 11 when using bootstrap_container_definition.

Changes

  • Code fix: Wrap \Drupal::database() call in try-catch for ContainerNotInitializedException
  • Documentation: Update README.md and settings.redis.example.php with D11 compatibility notes
  • Tests: Add CacheBaseContainerCompatibilityTest (5 tests, 11 assertions)

Issue

#3564915

Why the existing fix is insufficient

Commit fbd11ae added hasContainer() check, but during D11's HookCollectorKeyValueWritePass, the container exists (hasContainer() returns TRUE) but database service throws ContainerNotInitializedException.

Merge request reports

Loading