From 31aa0f8c7372295f6d8ca6b2743ac1f30f2bfaa7 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Tue, 19 Nov 2024 14:51:05 +0000 Subject: [PATCH] Fix: Use database order if possible --- Editor/Options.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Editor/Options.php b/Editor/Options.php index 3f304cf..9c7a37d 100644 --- a/Editor/Options.php +++ b/Editor/Options.php @@ -375,6 +375,9 @@ public function exec($db, $refresh, $search = null) } $q->order($this->_order); + } else if ($this->_order === true) { + // Attempt to do a database order, needed for "limit()"ed results + $q->order($this->_label[0]); } $rows = $q @@ -426,7 +429,7 @@ public function exec($db, $refresh, $search = null) return is_numeric($aLabel) && is_numeric($bLabel) ? ($aLabel * 1) - ($bLabel * 1) : - strcmp($aLabel, $bLabel); + strcmp($aLabel, $bLabel); }); }