Problem/Motivation

Upgrade status report: 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.

on

status_dashboard/src/Collector.php:86
status_dashboard.install:100

Steps to reproduce

Scan with Upgrade Status module.

Proposed resolution

Add explicit access checks.

Remaining tasks

Provide issue fork/patch.

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

codebymikey created an issue. See original summary.

codebymikey’s picture

Title: Fix access check on query » Fix access check on query (Drupal 10 compatibility)
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new1.05 KB
bramdriesen’s picture

Status: Needs review » Needs work
Issue tags: +Novice

Thanks for the patch @codebymikey. A few remarks and then it's good to go.

  1. +++ b/src/Collector.php
    @@ -81,7 +81,7 @@ class Collector implements CollectorInterface {
    +        $query = $storage->getQuery()->accessCheck(FALSE);
    

    This line is a duplicate with 87 which was added in #3364916: [error] Drupal\Core\Entity\Query\QueryException: Entity queries must explicitly set whether the query should be access checked or not.

  2. +++ b/status_dashboard.install
    @@ -95,7 +95,7 @@ function status_dashboard_update_9103() {
    +  $query = $storage->getQuery()->accessCheck(FALSE);
    

    I prefer this to be on a new line like the rest.

codebymikey’s picture

Status: Needs work » Needs review

Thanks, updated the issue fork.

bramdriesen’s picture

Status: Needs review » Fixed

Thanks! Will tag a new release in a bit as well.

Status: Fixed » Closed (fixed)

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