Narrow the scope of when Lists orderBy conditions are reset.
Credit to @bennothommo & @daftspunk
Replaces: 9f8d8ec9fa. Refs: #4439
This commit is contained in:
parent
4ab464cede
commit
5f8a5454ee
|
|
@ -706,8 +706,11 @@ class RelationController extends ControllerBehavior
|
|||
});
|
||||
}
|
||||
else {
|
||||
$widget->bindEvent('list.extendQueryBefore', function ($query) {
|
||||
$widget->bindEvent('list.extendQueryBefore', function ($query) use ($widget) {
|
||||
$this->relationObject->addDefinedConstraintsToQuery($query);
|
||||
if ($widget->getSortColumn()) {
|
||||
$query->getQuery()->orders = [];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -532,7 +532,6 @@ class Lists extends WidgetBase
|
|||
$sortColumn = $column->relation . '_count';
|
||||
}
|
||||
|
||||
$query->getQuery()->orders = [];
|
||||
$query->orderBy($sortColumn, $this->sortDirection);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue