From 3896ae6e3566acbfc7211773f0e2d5d086a0c0d7 Mon Sep 17 00:00:00 2001 From: Adam Vessey Date: Tue, 20 Feb 2024 09:39:27 -0400 Subject: [PATCH] Move more explicitly to existence check. --- src/Access/QueryTagger.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Access/QueryTagger.php b/src/Access/QueryTagger.php index 009af6a..0de4128 100644 --- a/src/Access/QueryTagger.php +++ b/src/Access/QueryTagger.php @@ -147,14 +147,16 @@ public function tagAccess(SelectInterface $query, string $type) : void { // No embargo. $embargo = $this->database->select('embargo', 'ee'); $embargo->fields('ee', ['embargoed_node']); - $exist_or->condition("existence_node.nid", $embargo, 'NOT IN'); + $embargo->where('existence_node.nid = ee.embargoed_node'); + $exist_or->notExists($embargo); // Embargoed (and allowed). $accessible_embargoes = $this->buildAccessibleEmbargoesQuery(match($type) { 'file', 'media' => EmbargoInterface::EMBARGO_TYPE_FILE, 'node' => EmbargoInterface::EMBARGO_TYPE_NODE, }); - $exist_or->condition("existence_node.nid", $accessible_embargoes, 'IN'); + $accessible_embargoes->where('existence_node.nid = e.embargoed_node'); + $exist_or->exists($accessible_embargoes); $existence->condition($exist_or);