Problem/Motivation

accessCheck() required on views plugin

without accessCheck(), views throw the following error:
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 /var/www/html/web/core/lib/Drupal/Core/Entity/Query/Sql/Query.php).

Steps to reproduce

Proposed resolution

see patch

Remaining tasks

User interface changes

API changes

Data model changes

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

kay_v created an issue. See original summary.

sarwan_verma’s picture

Assigned: Unassigned » sarwan_verma

kay_v’s picture

Assigned: sarwan_verma » Unassigned
sarwan_verma’s picture

Status: Active » Needs review
StatusFileSize
new653 bytes

Hello @kay_v,
I have fixed this issue add accessCheck() to views plugin and also attached patch,
please review and verify.

kay_v’s picture

hi @sarwan_verma - thanks for your surprisingly quick attention to this issue. I'd actually had a fix ready on my local when I filed the issue. Please feel free to have a look at the MR and add any comments. It looks quite different from your approach.

Interested in your thoughts.

sarwan_verma’s picture

Hi@kay_v,
Thanks in advance.

  • edysmp committed 7c0d3670 on 3.0.x authored by kay_v
    Issue #3391498 by kay_v, sarwan_verma: add accessCheck() to views plugin
    
edysmp’s picture

Status: Needs review » Fixed

Committed and pushed to 3.0.x. Thanks!

Status: Fixed » Closed (fixed)

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