fix for FormHelper:create()

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3997 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2006-11-27 19:56:06 +00:00
parent f5cdfcfd32
commit 083a3bf990

View file

@ -88,7 +88,7 @@ class FormHelper extends AppHelper {
'validates' => array_keys($object->validate)
);
if (isset($this->data[$model]) && isset($this->data[$model][$object['key']]) && !empty($this->data[$model][$object['key']])) {
if (isset($this->data[$model]) && isset($this->data[$model][$data['key']]) && !empty($this->data[$model][$data['key']])) {
$created = true;
}
$options = am(array('type' => ($created && empty($options['action'])) ? 'put' : 'post', 'id' => $model . 'Form', 'action' => array()), $options);
@ -237,6 +237,8 @@ class FormHelper extends AppHelper {
if (isset($options['label'])) {
$label = $options['label'];
unset($options['label']);
} else {
$label = Inflector::humanize($this->field());
}
$out = $this->label($tagName, $label);
@ -245,6 +247,8 @@ class FormHelper extends AppHelper {
if (isset($options['error'])) {
$error = $options['error'];
unset($options['error']);
} else {
$error = $label . ' is required';
}
$selected = null;