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

Created on 24 March 2023, about 2 years ago
Updated 23 May 2023, almost 2 years ago

Problem/Motivation

Recreating the checksum is broken with Drupal 10 currently:

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: 34)
Drupal\media_duplicates\MediaDuplicatesChecksumBatch::tasks() (Line: 107)
Drupal\media_duplicates\Form\RebuildDuplicatesForm->submitForm()

Here's the core change record: https://www.drupal.org/node/3201242 (Drupal 9.2)

Steps to reproduce

Go to /admin/config/media/media-duplicates/refresh in Drupal 10 and recreate the checksums

Proposed resolution

Add access check.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇩🇪Germany Anybody Porta Westfalica

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

Comments & Activities

Production build 0.71.5 2024