Problem/Motivation
When visiting a user/x path that does not have a user parameter in its route, the following exception occurs:
RuntimeException: Callable "Drupal\userprotect\Access\UserProtectRoleAccessCheck::access" requires a value for the "$user" argument. in Drupal\Component\Utility\ArgumentsResolver->handleUnresolvedArgument() (line 149 of core/lib/Drupal/Component/Utility/ArgumentsResolver.php).
This happens on a site where User Protect, Role Delegation and Group invite and Views are installed.
Steps to reproduce
- Install User Protect, Role Delegation and Group invite and Views.
- Visit /user/group-invitations
Proposed resolution
In UserProtectRoleAccessCheck::access() do not require the $user parameter. Instead require a RouteMatchInterface object and check if the user parameter exists on the route before using it for access checks.
Remaining tasks
- Review
- Merge
User interface changes
None.
API changes
None.
Data model changes
None.
Issue fork userprotect-3568175
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
Comment #3
megachrizComment #4
megachrizThe code is scheduled to be merged!