1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-15 11:14:12 +02:00

Fix issue in FieldtypeComments::find() where "sort=something" selector wasn't always working if DatabaseQuerySelectFulltext modified the query

This commit is contained in:
Ryan Cramer
2018-05-30 07:29:00 -04:00
parent bdaf8810cb
commit 46e774ba38

View File

@@ -1222,7 +1222,13 @@ class FieldtypeComments extends FieldtypeMulti {
$countQuery->leftjoin($leftJoin);
}
if(empty($sorts)) $sorts[] = "$table.created DESC";
if(count($selectQuery->get('orderby')) && !empty($sorts)) {
$selectQuery->set('orderby', array());
}
if(empty($sorts)) {
$sorts[] = "$table.created DESC";
}
$selectQuery->orderby(implode(',', $sorts));
$selectQuery->limit("$start,$limit");