$join->setCollection

This commit is contained in:
fogelito
2026-02-10 12:20:36 +02:00
parent a456ae5acb
commit 997aafc646
@@ -99,6 +99,17 @@ class XList extends Action
throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage());
}
$joins = Query::getJoinQueries($queries, false);
foreach ($joins as $join) {
$col = $authorization->skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $join->getCollection()));
if ($col->isEmpty() || (!$col->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) {
throw new Exception($this->getParentNotFoundException(), params: [$join->getCollection()]);
}
$join->setCollection('database_' . $database->getSequence() . '_collection_' . $col->getSequence());
}
$cursor = Query::getCursorQueries($queries, false);
$cursor = \reset($cursor);