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).
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mhavelant created an issue. See original summary.

mhavelant’s picture

Update: 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.

mhavelant’s picture

Title: Redis module compatibility » Dependency injection issues
Status: Active » Needs review
e0ipso’s picture

Status: Needs review » Fixed

Thanks for the patch! This looks great.

  • e0ipso committed f4ec7eb on 8.x-1.x authored by mhavelant
    Issue #3118684 by mhavelant: Dependency injection issues
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.