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
This commit is contained in:
gwoo 2008-01-19 21:16:34 +00:00
parent 5b29c6a71f
commit 1c3d18db23

View file

@ -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;