mirror of
https://github.com/processwire/processwire.git
synced 2025-08-16 03:34:33 +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);
|
$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->orderby(implode(',', $sorts));
|
||||||
$selectQuery->limit("$start,$limit");
|
$selectQuery->limit("$start,$limit");
|
||||||
|
Reference in New Issue
Block a user