Force ordering when list widget column is sorted
When ordering is applied externally, ie. by a relation config, the orderBy call in the List widget simply adds an additional field to the ordering clauses, which prevents lists in these scenarios from being re-ordered correctly. This changes the order clause so that the ordering is reset and only the specified column is ordered when the user sorts a column. Developers can continue to use the `extendQuery` event to do specialised custom ordering if required. Fixes #4439.
This commit is contained in:
parent
1283121069
commit
9f8d8ec9fa
|
|
@ -532,6 +532,7 @@ class Lists extends WidgetBase
|
|||
$sortColumn = $column->relation . '_count';
|
||||
}
|
||||
|
||||
$query->getQuery()->orders = [];
|
||||
$query->orderBy($sortColumn, $this->sortDirection);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue