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.

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

megachriz created an issue. See original summary.

megachriz’s picture

Status: Active » Needs review
megachriz’s picture

Status: Needs review » Fixed

The code is scheduled to be merged!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • megachriz committed 8707afbb on 8.x-1.x
    Issue #3568175 by megachriz: Fixed RuntimeException on a user/x path...

Status: Fixed » Closed (fixed)

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