Problem/Motivation

WSOD error visiting site audit reports (/admin/reports/site-audit/reports):

Drupal\Core\Entity\Query\QueryException: Entity queries must explicitly set whether the query should be access checked or not. See Drupal\Core\Entity\Query\QueryInterface::accessCheck(). in Drupal\Core\Entity\Query\Sql\Query->prepare() (line 141 of core/lib/Drupal/Core/Entity/Query/Sql/Query.php).

Proposed resolution

Requires access check in site_audit/site_audit_report_entity/src/SiteAuditReportListBuilder.php load():

public function load() {
    // Sorting my entities.
    $entity_query = \Drupal::entityQuery('site_audit_report')
      ->sort('created' , 'DESC')
      ->accessCheck(FALSE);
...
CommentFileSizeAuthor
site-audit-access-check.patch649 bytesrobcarr

Issue fork site_audit-3404964

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

robcarr created an issue. See original summary.

robcarr changed the visibility of the branch 3404964-entity-queries-to to hidden.

rajab natshah’s picture

Title: Entity queries to check access » Fix check access for Entity queries under Drupal 10
Issue tags: +Drupal 10 compatibility

I am facing the same issue.
Thank you, Rob, for the fix

rajab natshah’s picture

Priority: Normal » Critical
rajab natshah’s picture

Status: Needs review » Reviewed & tested by the community
adwivedi008’s picture

Version: 4.0.0-rc5 » 4.1.1

I was also facing the issue and can confirm MR12 fixes the issue

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

froboy’s picture

Reviewed and tested. Thanks.

froboy’s picture

Version: 4.1.1 » 4.1.2
Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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