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

Comments

klimp created an issue. See original summary.

klimp’s picture

damienmckenna’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: metatag-resolve_access_check-3352508-2.patch, failed testing. View results

damienmckenna’s picture

Status: Needs work » Needs review

The test failure was unrelated to this issue, so I'm rerunning the tests.

damienmckenna’s picture

It's interesting how these problems didn't show up in the manual testing or automated tests..

damienmckenna’s picture

Presuming this is actually needed, let's include it in the next release.

damienmckenna’s picture

StatusFileSize
new1.6 KB

I think it's worth using accessCheck(FALSE) on these.

  • DamienMcKenna committed 30ee0152 on 8.x-1.x authored by klimp
    Issue #3352508 by DamienMcKenna, klimp: Resolve access check errors for...

  • DamienMcKenna committed 03b2104d on 2.0.x authored by klimp
    Issue #3352508 by DamienMcKenna, klimp: Resolve access check errors for...
damienmckenna’s picture

Status: Needs review » Fixed

Committed. Thank you.

Status: Fixed » Closed (fixed)

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