Event is supposed to come *after* default constraints

This commit is contained in:
Samuel Georges 2015-07-25 14:22:31 +10:00
parent 3866ccbb20
commit fc62ca7c7f
1 changed files with 3 additions and 3 deletions

View File

@ -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);
});
}