Problem/Motivation

If you use the restrict_by_ip module (just one example), you are unable to access the Flood Unblock page at admin/people/flood-unblock. When you try, you get an error.

Steps to reproduce

* Install and enable restrict_by_ip
* Install and enable flood_control
* Go to admin/people/flood-unblock
* Observe error:
The website encountered an unexpected error. Please try again later.
TypeError: Argument 4 passed to Drupal\flood_control\Form\FloodUnblockAdminForm::__construct() must be an instance of Drupal\Core\Session\AccountProxy, instance of Drupal\restrict_by_ip\Session\AccountProxy given, called in /app/web/modules/contrib/flood_control/src/Form/FloodUnblockAdminForm.php on line 83 in Drupal\flood_control\Form\FloodUnblockAdminForm->__construct() (line 67 of modules/contrib/flood_control/src/Form/FloodUnblockAdminForm.php).

Proposed resolution

Update the class to use the AccountProxyInterface to make it compatible with other modules that provide their own account proxy.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

nicrodgers created an issue. See original summary.

nicrodgers’s picture

Status: Active » Needs review
jonnyhocks’s picture

Status: Needs review » Reviewed & tested by the community

Reproduced the error on a fresh install of Drupal along with restrict_by_ip. Reviewed the changes and tested them and can confirm that the error detailed no longer displays after applying the changes.

fabianderijk’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, I've just merged the MR

Status: Fixed » Closed (fixed)

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