Problem/Motivation

Relevant change record is available here: https://www.drupal.org/node/3201242

The following snippet makes an entity query without specifying the relevant ::accessCheck(), which is deprecated in 9.2.0 and will throw an exception in Drupal 10 ([#https://www.drupal.org/project/drupal/issues/3244802]).

https://git.drupalcode.org/project/asset_injector/-/blob/a5446e4e/asset_...

Steps to reproduce

Run a scan of the module with the latest version of https://www.drupal.org/project/upgrade_status

It'll display the following warning:

Relying on entity queries to check access by default is deprecated in drupal:9.2.0 and an error will be thrown from drupal:10.0.0. Call \Drupal\Core\Entity\Query\QueryInterface::accessCheck() with TRUE or FALSE to specify whether access should be checked.

Proposed resolution

Explicitly set whether the query should be access checked or not in the entity query. It should be checked.

Remaining tasks

Provide issue fork/patch.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

codebymikey created an issue. See original summary.

codebymikey’s picture

Issue summary: View changes

This change doesn't necessarily apply to config entities, but it's better to be safe than sorry by being explicit.

bharath-kondeti made their first commit to this issue’s fork.

bharath-kondeti’s picture

Priority: Major » Critical
Status: Active » Needs review

Hello, I have worked on fix and raised an MR. Please review the same https://git.drupalcode.org/project/asset_injector/-/merge_requests/10

bharath-kondeti’s picture

Priority: Critical » Major

pookmish’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.