Event is supposed to come *after* default constraints
This commit is contained in:
parent
3866ccbb20
commit
fc62ca7c7f
|
|
@ -578,7 +578,6 @@ class RelationController extends ControllerBehavior
|
|||
*/
|
||||
$widget = $this->makeWidget('Backend\Widgets\Lists', $config);
|
||||
$widget->bindEvent('list.extendQuery', function ($query) {
|
||||
$this->controller->relationExtendQuery($query, $this->field);
|
||||
$this->relationObject->setQuery($query);
|
||||
|
||||
$sessionKey = $this->deferredBinding ? $this->relationGetSessionKey() : null;
|
||||
|
|
@ -590,6 +589,8 @@ class RelationController extends ControllerBehavior
|
|||
$this->relationObject->addConstraints();
|
||||
}
|
||||
|
||||
$this->controller->relationExtendQuery($query, $this->field);
|
||||
|
||||
/*
|
||||
* Allows pivot data to enter the fray
|
||||
*/
|
||||
|
|
@ -722,8 +723,6 @@ class RelationController extends ControllerBehavior
|
|||
*/
|
||||
if ($this->manageMode == 'pivot' || $this->manageMode == 'list') {
|
||||
$widget->bindEvent('list.extendQuery', function ($query) {
|
||||
$this->controller->relationExtendQuery($query, $this->field);
|
||||
|
||||
/*
|
||||
* Where not in the current list of related records
|
||||
*/
|
||||
|
|
@ -732,6 +731,7 @@ class RelationController extends ControllerBehavior
|
|||
$query->whereNotIn($this->relationModel->getQualifiedKeyName(), $existingIds);
|
||||
}
|
||||
|
||||
$this->controller->relationExtendQuery($query, $this->field);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue