QueryAccessHandlerBase has switched signature variables

Created on 30 June 2023, 12 months ago

Problem/Motivation

eventDispatcher->dispatch has the variables in the called method reversed.

Steps to reproduce

When loading /admin/group I get the following error (after applying patch at https://drupal.org/node/3371641)

TypeError: Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher::dispatch(): Argument #1 ($event) must be of type object, string given, called in /var/www/web/modules/contrib/group/src/Entity/Access/QueryAccessHandlerBase.php on line 90 in Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (line 89 of core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php).

Proposed resolution

Lines 90 and 91 of QueryAccessHandlerBase::getConditions

$this->eventDispatcher->dispatch("entity.query_access", $event);
$this->eventDispatcher->dispatch("entity.query_access.{$entity_type_id}", $event);

Should be changed to

$this->eventDispatcher->dispatch( $event, "entity.query_access");
$this->eventDispatcher->dispatch($event, "entity.query_access.{$entity_type_id}");
πŸ› Bug report
Status

Active

Version

1.5

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Chris Dart

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024