Skip to content

Commit 31aa0f8

Browse files
committed
Fix: Use database order if possible
1 parent c80526e commit 31aa0f8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Editor/Options.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,9 @@ public function exec($db, $refresh, $search = null)
375375
}
376376

377377
$q->order($this->_order);
378+
} else if ($this->_order === true) {
379+
// Attempt to do a database order, needed for "limit()"ed results
380+
$q->order($this->_label[0]);
378381
}
379382

380383
$rows = $q
@@ -426,7 +429,7 @@ public function exec($db, $refresh, $search = null)
426429

427430
return is_numeric($aLabel) && is_numeric($bLabel) ?
428431
($aLabel * 1) - ($bLabel * 1) :
429-
strcmp($aLabel, $bLabel);
432+
strcmp($aLabel, $bLabel);
430433
});
431434
}
432435

0 commit comments

Comments
 (0)