Error during module install on Drupal 10

Created on 13 April 2023, over 1 year ago
Updated 27 April 2023, over 1 year ago

Problem/Motivation

An exception is thrown when installing the module in Drupal 10:

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->prepare() (Line: 80)
Drupal\Core\Entity\Query\Sql\Query->execute() (Line: 82)
Drupal\node_singles\Service\NodeSingles->checkSingle(Object) (Line: 36)
Drupal\node_singles\EventSubscriber\NodeTypeUpdateEventSubscriber->checkForSingles(Object) (Line: 93)
node_singles_entity_insert(Object, 'node_type') (Line: 52)

Proposed resolution

Add ->accessCheck() to all entity queries.

🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

🇧🇪Belgium dieterholvoet Brussels

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

Comments & Activities

Production build 0.71.5 2024