Drupal 10 add accessCheck to query

Created on 20 November 2023, 7 months ago
Updated 23 November 2023, 7 months ago

Problem/Motivation

500 Error on Drupal 10,

The website encountered an unexpected error. Please try again later.
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: 30)
Drupal\votingapi\VoteResultStorage->getEntityResults('node', '44', 'like', 'vote_sum') (Line: 65)

Steps to reproduce

Use class VoteResultStorage -> getEntityResults() in Drupal 10.

Proposed resolution

Add accessCheck to query.

πŸ› Bug report
Status

Closed: works as designed

Component

Code

Created by

πŸ‡΅πŸ‡±Poland Pawelgorski87

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

Comments & Activities

Production build 0.69.0 2024