Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi, I get the following error when using the redis module (and PHP 7.3, didn't test with other PHP versions):
The website encountered an unexpected error. Please try again later.
TypeError: Argument 2 passed to Drupal\rate_limits\EventSubscriber\RequestSubscriberCheckLimits::__construct() must be an instance of Drupal\Core\Flood\DatabaseBackend, instance of Drupal\redis\Flood\PhpRedis given, called in /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 281 in Drupal\rate_limits\EventSubscriber\RequestSubscriberCheckLimits->__construct() (line 46 of modules/contrib/rate_limits/src/EventSubscriber/RequestSubscriberCheckLimits.php).
Comment | File | Size | Author |
---|---|---|---|
#2 | dependency-injection-fix.3118684-2.patch | 2.6 KB | mhavelant |
|
Comments
Comment #2
mhavelant CreditAttribution: mhavelant at Brainsum for Tieto commentedUpdate: replacing DatabaseBackend with FloodInterface solves the issue.
So, this is more of a dependency injection issue rather than a Redis compatibility one.
The "Router" service shoul be added with RouterInterface as well.
I attached a patch for this.
Comment #3
mhavelant CreditAttribution: mhavelant at Brainsum for Tieto commentedComment #4
e0ipsoThanks for the patch! This looks great.