Problem/Motivation

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.

Steps to reproduce

See field_defaults.module L123 and following

Proposed resolution

Move ->accessCheck(FALSE) from within the if clause to the outside.

Comments

mvogel created an issue. See original summary.

  • b_sharpe committed dd1f0720 on 2.0.x
    Issue #3336859 by mvogel, b_sharpe: Drupal 10: Entity Query need...
b_sharpe’s picture

Status: Active » Fixed

Thanks!

mvogel’s picture

It seems you forgot to move the "accessCheck" to the outside of the if clause. And there is a second occurrence in the .module - file (see patch)

Status: Fixed » Closed (fixed)

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

rsnyd’s picture

StatusFileSize
new1.88 KB

Replacing the accessChecks within the if statements.

rsnyd’s picture

StatusFileSize
new1.57 KB