From 1c3d18db2316dd6e1c652b66dbda906aaffe5ac8 Mon Sep 17 00:00:00 2001 From: gwoo Date: Sat, 19 Jan 2008 21:16:34 +0000 Subject: [PATCH] updating form.php, fixes #3942 "FormHelper::create() ignores non-standard primary key" git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6389 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/view/helpers/form.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index e3677002c..fb352a347 100644 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -82,7 +82,6 @@ class FormHelper extends AppHelper { */ function create($model = null, $options = array()) { $defaultModel = null; - $data = $this->fieldset; $view =& ClassRegistry::getObject('view'); if (is_array($model) && empty($options)) { @@ -134,6 +133,7 @@ class FormHelper extends AppHelper { 'validates' => (ife(empty($object->validate), array(), array_keys($object->validate))) ); } + $data = $this->fieldset; if (isset($this->data[$model]) && isset($this->data[$model][$data['key']]) && !empty($this->data[$model][$data['key']])) { $created = true;