From f85493e333d893858e61dc918aaa17e9898ac6ac Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Sat, 4 Jul 2015 13:42:37 +1000 Subject: [PATCH] Don't use Deferred Binding if it is disabled --- modules/backend/behaviors/RelationController.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/backend/behaviors/RelationController.php b/modules/backend/behaviors/RelationController.php index 5a0963960..cab4f1d0e 100644 --- a/modules/backend/behaviors/RelationController.php +++ b/modules/backend/behaviors/RelationController.php @@ -580,9 +580,11 @@ 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); - if ($sessionKey = $this->relationGetSessionKey()) { + + $sessionKey = $this->deferredBinding ? $this->relationGetSessionKey() : null; + + if ($sessionKey) { $this->relationObject->withDeferred($sessionKey); } elseif ($this->model->exists) {