From b75495cccc0901f641244747989abc77ad0842fc Mon Sep 17 00:00:00 2001 From: SilverFire - Dmitry Naumenko Date: Tue, 9 Feb 2016 18:45:23 +0200 Subject: [PATCH] Collection::setModel - fixed working with scenario --- src/Collection.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Collection.php b/src/Collection.php index e6f5271..d382ae8 100644 --- a/src/Collection.php +++ b/src/Collection.php @@ -113,9 +113,11 @@ public function setModel($model) } else { $this->model = Yii::createObject($model); } + + $model = $this->model; $this->updateFormName(); - if (empty($this->getScenario()) && $model->scenario !== $model::SCENARIO_DEFAULT) { + if (empty($this->getScenario())) { $this->setScenario($model->scenario); }