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.

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

DieterHolvoet created an issue. See original summary.

  • DieterHolvoet committed 196465cb on 3.x
    Issue #3354008 by DieterHolvoet: Error during module install on Drupal...
dieterholvoet’s picture

Status: Active » Fixed
Related issues: +#3288786: Automated Drupal 10 compatibility fixes

Status: Fixed » Closed (fixed)

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