Be less strict about formExtendModel returning a model

This commit is contained in:
Samuel Georges 2016-04-28 05:47:14 +10:00
parent 0d8a30730e
commit 0d451eaa78
1 changed files with 3 additions and 4 deletions

View File

@ -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;
}
/**