GroupContentListBuilder::getEntityIds() missing accessCheck

Created on 30 June 2023, almost 2 years ago

Problem/Motivation

In Drupal 10 the method GroupContentListBuilder::getEntitiyIds() has a db query that's missing an accessCheck().

Steps to reproduce

In a D-10 site running 8.x-1.5, going to admin/group returns this error

Drupal\Core\Entity\Query\QueryException: Entity queries must explicitly set whether the query should be access checked or not. See Drupal\Core\Entity\Query\QueryInterface::accessCheck(). in Drupal\Core\Entity\Query\Sql\Query->prepare() (line 141 of core/lib/Drupal/Core/Entity/Query/Sql/Query.php).
Drupal\Core\Entity\Query\Sql\Query->execute() (Line: 160)
Drupal\group\Entity\Controller\GroupListBuilder->getEntityIds() (Line: 86)

Proposed resolution

add an accessCheck() to the $query (copy the pattern in https://git.drupalcode.org/project/group/-/blob/2.1.x/src/Entity/Control...)

πŸ› Bug report
Status

Closed: duplicate

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.71.5 2024