From d62943b838b6bf81f404c04a09c8deb952c91353 Mon Sep 17 00:00:00 2001 From: Kristen Pol Date: Fri, 22 Sep 2023 17:15:44 +1000 Subject: [PATCH] Add accessCheck for entity queries for Drupal 10 compatibility. --- modules/quant_search/src/Form/QuantSearchPageForm.php | 1 + src/EventSubscriber/CollectionSubscriber.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/quant_search/src/Form/QuantSearchPageForm.php b/modules/quant_search/src/Form/QuantSearchPageForm.php index 0e458dd3..f4dc1ce7 100644 --- a/modules/quant_search/src/Form/QuantSearchPageForm.php +++ b/modules/quant_search/src/Form/QuantSearchPageForm.php @@ -536,6 +536,7 @@ public function save(array $form, FormStateInterface $form_state) { public function exist($id) { $entity = $this->entityTypeManager->getStorage('quant_search_page')->getQuery() ->condition('id', $id) + ->accessCheck(TRUE) ->execute(); return (bool) $entity; } diff --git a/src/EventSubscriber/CollectionSubscriber.php b/src/EventSubscriber/CollectionSubscriber.php index b84a273b..fcb268c5 100644 --- a/src/EventSubscriber/CollectionSubscriber.php +++ b/src/EventSubscriber/CollectionSubscriber.php @@ -118,7 +118,7 @@ public function collectEntities(CollectEntitiesEvent $event) { */ public function collectRedirects(CollectRedirectsEvent $event) { $query = $this->entityTypeManager->getStorage('redirect')->getQuery(); - $ids = $query->execute(); + $ids = $query->accessCheck(TRUE)->execute(); foreach ($ids as $id) { $redirect = Redirect::load($id);