From 0d451eaa78e786585393852035a932983f273be9 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Thu, 28 Apr 2016 05:47:14 +1000 Subject: [PATCH] Be less strict about formExtendModel returning a model --- modules/backend/behaviors/FormController.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/backend/behaviors/FormController.php b/modules/backend/behaviors/FormController.php index 0ecd49f40..3afaf2721 100644 --- a/modules/backend/behaviors/FormController.php +++ b/modules/backend/behaviors/FormController.php @@ -185,7 +185,7 @@ class FormController extends ControllerBehavior ); $model = $this->controller->formCreateModelObject(); - $model = $this->controller->formExtendModel($model); + $model = $this->controller->formExtendModel($model) ?: $model; $this->initForm($model); } @@ -203,7 +203,7 @@ class FormController extends ControllerBehavior $this->context = strlen($context) ? $context : $this->getConfig('create[context]', self::CONTEXT_CREATE); $model = $this->controller->formCreateModelObject(); - $model = $this->controller->formExtendModel($model); + $model = $this->controller->formExtendModel($model) ?: $model; $this->initForm($model); @@ -633,7 +633,7 @@ class FormController extends ControllerBehavior ])); } - $result = $this->controller->formExtendModel($result); + $result = $this->controller->formExtendModel($result) ?: $result; return $result; } @@ -704,7 +704,6 @@ class FormController extends ControllerBehavior */ public function formExtendModel($model) { - return $model; } /**