mirror of
https://github.com/flarum/core.git
synced 2025-10-14 16:34:26 +02:00
Fix relevance sort (#2773)
- Adds a field to QueryCriteria that determines whether the sort provided is the controller's default sort - Set this field to true iff sort not in query params. Default it to false - Override $sort if a new default sort has been set on search state, and the param is true. - Add tests!
This commit is contained in:
committed by
GitHub
parent
548f1321f1
commit
b6f0b01307
@@ -65,7 +65,7 @@ abstract class AbstractFilterer
|
||||
}
|
||||
}
|
||||
|
||||
$this->applySort($filterState, $criteria->sort);
|
||||
$this->applySort($filterState, $criteria->sort, $criteria->sortIsDefault);
|
||||
$this->applyOffset($filterState, $offset);
|
||||
$this->applyLimit($filterState, $limit + 1);
|
||||
|
||||
|
Reference in New Issue
Block a user