Fixing $model parameter for FormHelper::create(). Must pass false if the form is not associated with a model.

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4295 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2007-01-16 07:07:49 +00:00
parent e049d680e0
commit 23cb3451c0

View file

@ -77,9 +77,11 @@ class FormHelper extends AppHelper {
if (is_array($model) && empty($options)) {
$options = $model;
}
if (!is_null($model) && (empty($model) || is_array($model))) {
if ($model !== false) {
$model = $this->params['models'][0];
}
if (ClassRegistry::isKeySet($model)) {
$object =& ClassRegistry::getObject($model);
}