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.
Issue fork asset_injector-3356302
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
Comment #2
codebymikey commentedThis change doesn't necessarily apply to config entities, but it's better to be safe than sorry by being explicit.
Comment #5
bharath-kondeti commentedHello, I have worked on fix and raised an MR. Please review the same https://git.drupalcode.org/project/asset_injector/-/merge_requests/10
Comment #6
bharath-kondeti commentedComment #8
pookmish commented