Also remove custom sorts from relationcontroller lists / pivot manage modes.

Fixes https://github.com/octobercms/october/issues/4335#issuecomment-643706004, refs: 5f8a5454ee
This commit is contained in:
Luke Towers 2020-06-14 14:29:21 -06:00
parent b7d9bd1ca6
commit 24f87ae10e
1 changed files with 4 additions and 1 deletions

View File

@ -856,8 +856,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 = [];
}
});
}