From 73c24829d33ece49da76d0adedcf0ab994f8728a Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Sat, 15 Mar 2025 23:40:30 +1300 Subject: [PATCH] Skip implicit order if internal ID order found --- src/Database/Adapter/MariaDB.php | 2 +- src/Database/Adapter/Postgres.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Database/Adapter/MariaDB.php b/src/Database/Adapter/MariaDB.php index ef3b91656..cc7b5338c 100644 --- a/src/Database/Adapter/MariaDB.php +++ b/src/Database/Adapter/MariaDB.php @@ -2076,7 +2076,7 @@ public function find(string $collection, array $queries = [], ?int $limit = 25, $hasIdAttribute = false; foreach ($orderAttributes as $i => $attribute) { - if ($attribute === '_uid') { + if (\in_array($attribute, ['_uid', '_id'])) { $hasIdAttribute = true; } diff --git a/src/Database/Adapter/Postgres.php b/src/Database/Adapter/Postgres.php index 903ecbf1b..65d5c076e 100644 --- a/src/Database/Adapter/Postgres.php +++ b/src/Database/Adapter/Postgres.php @@ -1854,7 +1854,7 @@ public function find(string $collection, array $queries = [], ?int $limit = 25, $hasIdAttribute = false; foreach ($orderAttributes as $i => $attribute) { - if ($attribute === '_uid') { + if (\in_array($attribute, ['_uid', '_id'])) { $hasIdAttribute = true; }