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

Created on 14 March 2023, almost 2 years ago

Problem/Motivation

When exporting taxonomies via Drush I get the a QueryInterface::accessCheck() error. When performing the same action from the web UI we get the "The website encountered an unexpected error. Please try again later." WSOD and the error is written to the error log.

unifex@dione:~/Projects/modestneeds$ lando drush export-taxonomies
Exporting taxonomies...
 [notice] Taxonomies export started

In Query.php line 141:
                                                                                                                                                     
  Entity queries must explicitly set whether the query should be access checked or not. See Drupal\Core\Entity\Query\QueryInterface::accessCheck().

Steps to reproduce

Run drush export-taxonomies or visit /admin/structure/structure-sync/taxonomies, select a taxonomy, and click "Export Taxonomies".

Proposed resolution

The following changelog looks to address this issue.

Access checking must be explicitly specified on content entity queries

We just need to add $query->accessCheck(FALSE); to the right place.

🐛 Bug report
Status

Closed: duplicate

Version

2.0

Component

Code

Created by

🇳🇿New Zealand Gold 20 minutes in the future

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

Comments & Activities

Production build 0.71.5 2024