Problem/Motivation

While working on upgrades to Drupal 10 Upgrade status provided these errors as needing to be resolved manually:

FILE: web/modules/contrib/recaptcha_v3/src/Form/ReCaptchaV3ActionDeleteForm.php

STATUS         LINE                           MESSAGE
--------------------------------------------------------------------------------
Check manually 20   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

Call \Drupal\Core\Entity\Query\QueryInterface::accessCheck() with TRUE

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

klimp created an issue. See original summary.

klimp’s picture

dench0’s picture

Status: Active » Closed (works as designed)

@klimp
thanks for the reporting but accessCheck does not make any sense for the config entities.
PS: here is one example from the Drupal core https://git.drupalcode.org/project/drupal/-/blob/10.1.x/core/modules/fie...

hmdnawaz made their first commit to this issue’s fork.

hmdnawaz’s picture

Status: Closed (works as designed) » Needs review

@dench0 your link does not have any example you mentioned.

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.

Created an MR and re-opening the issue.

dench0’s picture

Status: Needs review » Closed (works as designed)

Sorry, it was already overwritten, here is a new link:
https://git.drupalcode.org/project/drupal/-/blob/10.0.x/core/modules/fie...

And pls read carefully the change record.