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:
@@ -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");
|
||||
|
Reference in New Issue
Block a user