From b7633969b465881434f1f1e58c616388a18405cc Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 27 Aug 2025 03:44:27 +1200 Subject: [PATCH] Fix request filter for selections --- src/Appwrite/Utopia/Request/Filters/V20.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Appwrite/Utopia/Request/Filters/V20.php b/src/Appwrite/Utopia/Request/Filters/V20.php index bb25f39c8e..939eeeabe7 100644 --- a/src/Appwrite/Utopia/Request/Filters/V20.php +++ b/src/Appwrite/Utopia/Request/Filters/V20.php @@ -33,7 +33,7 @@ class V20 extends Filter protected function manageSelectQueries(array $content): array { $hasWildcard = false; - if (! isset($content['queries'])) { + if (!isset($content['queries'])) { $hasWildcard = true; // only query, make it json encoded! $content['queries'] = [Query::select(['*'])->toString()]; @@ -48,7 +48,11 @@ class V20 extends Filter $selections = Query::groupByType($parsed)['selections'] ?? []; - if (! $hasWildcard) { + // If there are no select queries at all, add wildcard + if (empty($selections)) { + $hasWildcard = true; + $parsed[] = Query::select(['*']); + } else if (!$hasWildcard) { // check if any select includes a wildcard as we added one above foreach ($selections as $select) { if (\in_array('*', $select->getValues(), true)) {