Skip to content

Commit

Permalink
Event is supposed to come *after* default constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
daftspunk committed Jul 25, 2015
1 parent 3866ccb commit fc62ca7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/backend/behaviors/RelationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,6 @@ protected function makeViewWidget()
*/
$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;
Expand All @@ -590,6 +589,8 @@ protected function makeViewWidget()
$this->relationObject->addConstraints();
}

$this->controller->relationExtendQuery($query, $this->field);

/*
* Allows pivot data to enter the fray
*/
Expand Down Expand Up @@ -722,8 +723,6 @@ protected function makeManageWidget()
*/
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
*/
Expand All @@ -732,6 +731,7 @@ protected function makeManageWidget()
$query->whereNotIn($this->relationModel->getQualifiedKeyName(), $existingIds);
}

$this->controller->relationExtendQuery($query, $this->field);
});
}

Expand Down

0 comments on commit fc62ca7

Please sign in to comment.