Problem/Motivation
While working on upgrades to Drupal 10 Upgrade status provided these errors as needing to be resolved manually:
FILE:
web/modules/contrib/metatag/metatag_routes/src/Form/MetatagCustomCreateForm.php
STATUS LINE MESSAGE
--------------------------------------------------------------------------------
Check manually 147 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.
--------------------------------------------------------------------------------
FILE: web/modules/contrib/metatag/src/MetatagDefaultsListBuilder.php
STATUS LINE MESSAGE
--------------------------------------------------------------------------------
Check manually 28 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.
--------------------------------------------------------------------------------
Check manually 63 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
The same issue occurs in metatag_open_graph but it has already been merged into dev - https://www.drupal.org/project/metatag/issues/3351181
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | metatag-n3352508-8.patch | 1.6 KB | damienmckenna |
| #2 | metatag-resolve_access_check-3352508-2.patch | 1.58 KB | klimp |
Comments
Comment #2
klimpComment #3
damienmckennaComment #5
damienmckennaThe test failure was unrelated to this issue, so I'm rerunning the tests.
Comment #6
damienmckennaIt's interesting how these problems didn't show up in the manual testing or automated tests..
Comment #7
damienmckennaPresuming this is actually needed, let's include it in the next release.
Comment #8
damienmckennaI think it's worth using accessCheck(FALSE) on these.
Comment #11
damienmckennaCommitted. Thank you.