Fix Exception "Entity queries must explicitly set whether the query should be access checked or not."

Created on 18 December 2023, 6 months ago

Problem/Motivation

The exception "Entity queries must explicitly set whether the query should be access checked or not." is thrown when retrieving a users current agreement for an entity. See this change record β†’ for more info.

Steps to reproduce

  1. Create a page that an anonymous user, for example, can not access/
  2. Create an agreement entity and add the above page path to the "Restrict - Restrict pages" field.
  3. Create a page that an anonymous user, for example, can not access.
  4. Select "Allow access to the specified pages" in the "Allow/restrict" dropdown.
  5. Save agreement and try to access the allowed url as an anonymous user.

Proposed resolution

Add accessCheck to the entityQuery in the userCurrentAgreement method of the "entity_agree.agreement_manager" service.

πŸ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States evilehk

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024