Skip to content

Commit 35ad38b

Browse files
authored
[3] backport of #35362 (#35383)
* backport of #35362 * comment
1 parent 8bfcacd commit 35ad38b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libraries/src/MVC/Model/BaseDatabaseModel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,11 +356,11 @@ protected function _getListCount($query)
356356

357357
// Otherwise fall back to inefficient way of counting all results.
358358

359-
// Remove the limit and offset part if it's a \JDatabaseQuery object
359+
// Remove the limit, offset and order parts if it's a \JDatabaseQuery object
360360
if ($query instanceof \JDatabaseQuery)
361361
{
362362
$query = clone $query;
363-
$query->clear('limit')->clear('offset');
363+
$query->clear('limit')->clear('offset')->clear('order');
364364
}
365365

366366
$this->getDbo()->setQuery($query);

0 commit comments

Comments
 (0)