Entity queries must explicitly set whether the query should be access checked or not

Created on 28 March 2023, over 1 year ago

Problem/Motivation

Here is the blocking error I encounter on Drupal 10.0.2 :

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: 72)
Drupal\mail_login\AuthDecorator->authenticate('...', '...') (Line: 219)

Steps to reproduce

Just install & enable the module, and log in.

Proposed resolution

According to this page :

[...] all entity queries on content entities should always include an explicit call to ::accessCheck() prior to the query being executed. For Drupal 10 this will be enforced by throwing an exception if ::accessCheck() is not called.

I created a merge request to fix this.

🐛 Bug report
Status

Fixed

Version

2.7

Component

Code

Created by

🇫🇷France benjbmc

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

Comments & Activities

Production build 0.71.5 2024