From dd514a3eb0d66438de08098317c5dee2715e566d Mon Sep 17 00:00:00 2001 From: Rosie Le Faive Date: Tue, 27 Jun 2023 12:23:44 -0300 Subject: [PATCH] Add accessCheck FALSE to all queries. --- src/IslandoraUtils.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/IslandoraUtils.php b/src/IslandoraUtils.php index f81cb747..41f84cbe 100644 --- a/src/IslandoraUtils.php +++ b/src/IslandoraUtils.php @@ -148,6 +148,7 @@ class IslandoraUtils { return []; } $mids = $this->entityTypeManager->getStorage('media')->getQuery() + ->accessCheck(FALSE) ->condition(self::MEDIA_OF_FIELD, $node->id()) ->execute(); if (empty($mids)) { @@ -208,6 +209,7 @@ class IslandoraUtils { // Query for media that reference this file. $query = $this->entityTypeManager->getStorage('media')->getQuery(); + $query->accessCheck(FALSE); $group = $query->orConditionGroup(); foreach ($conditions as $condition) { $group->condition($condition, $fid); @@ -252,6 +254,7 @@ class IslandoraUtils { } $results = $query + ->accessCheck(FALSE) ->condition($orGroup) ->execute(); @@ -498,6 +501,7 @@ class IslandoraUtils { array_walk($node_fields, $remove_entity); $query = $this->entityTypeManager->getStorage('media')->getQuery(); + $query->accessCheck(FALSE); $taxon_condition = $this->getEntityQueryOrCondition($query, $term_fields, $term->id()); $query->condition($taxon_condition); $node_condition = $this->getEntityQueryOrCondition($query, $node_fields, $node->id());