Missing Entity Query Access Check - D10 Compatibility Error

Created on 17 March 2023, over 1 year ago
Updated 5 December 2023, 12 months ago

Problem/Motivation

As of Drupal ^10 an exception is thrown on the page if an entityQuery is being used without defining the accessCheck. See https://www.drupal.org/node/3201242 .

Steps to reproduce

Attempt to save an entity using the video field with entering a value inside the video field. The following error will be visible on the page.

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: 397)
Drupal\video\Plugin\Field\FieldWidget\VideoEmbedWidget->extractFormValues() (Line: 237)
Drupal\Core\Entity\Entity\EntityFormDisplay->extractFormValues() (Line: 1278)

Proposed resolution

Add the accessCheck to the query.

🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

🇺🇸United States hershy.k

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024