WSOD due to "Entity queries must explicitly set whether the query should be access checked"

Created on 19 July 2023, over 1 year ago
Updated 22 July 2023, over 1 year ago

Problem/Motivation

On Drupal 10.1.x, if you add a non existent tag on a field, a dreaded WSOD will appear:

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

this is due to this change introduced on Drupal 9 and enforced on Drupal 10:

In Drupal 9.2, not calling ::accessCheck() has been deprecated, and all entity queries on content entities should always include an explicit call to ::accessCheck() prior to the query being executed. For Drupal 10 this will be enforced by throwing an exception if ::accessCheck() is not called.

Steps to reproduce

- Enable tagify on a node field
- Add nonexistent tags to the field when editing/creating a node
- The error will appear

Proposed resolution

Add access check.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇪🇸Spain idiaz.roncero Madrid

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

Comments & Activities

Production build 0.71.5 2024