PermanentDatabaseBackendFactory is not compatible with DatabaseBackendFactory in Drupal 11.0.1

Created on 22 August 2024, 4 months ago
Updated 16 September 2024, 3 months ago

Problem/Motivation

When using PCB in Drupal 11.0.1 an WSOD error occur which originates from the PCB module:

ArgumentCountError: Too few arguments to function Drupal\Core\Cache\DatabaseBackendFactory::__construct(), 2 passed in /var/www/html/core/lib/Drupal/Component/DependencyInjection/Container.php on line 264 and exactly 5 expected in /var/www/html/core/lib/Drupal/Core/Cache/DatabaseBackendFactory.php on line 42 #0 /var/www/html/core/lib/Drupal/Component/DependencyInjection/Container.php(264): Drupal\Core\Cache\DatabaseBackendFactory->__construct()

Steps to reproduce

Enable the PCB module in Drupal 11.0.1

Proposed resolution

Extend arguments for service "cache.backend.permanent_database" in pcb.services.yml with @settings, @serialization.phpserialize, and @datetime.time' making the full line to:
arguments: ['@database', '@cache_tags.invalidator.checksum', '@settings', '@serialization.phpserialize', '@datetime.time']

Change the get method in src/Cache/PermanentDatabaseBackendFactory line 17 with following:
return new PermanentDatabaseBackend($this->connection, $this->checksumProvider, $bin, $this->serializer, $this->time, $max_rows);

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

RTBC

Version

3.2

Component

Code

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024