diff --git a/cake/libs/view/helper.php b/cake/libs/view/helper.php index 8c3e93b40..fbda869e2 100644 --- a/cake/libs/view/helper.php +++ b/cake/libs/view/helper.php @@ -329,11 +329,11 @@ class Helper extends Overloadable { $parts = preg_split('/\/|\./', $entity); if($parts[0] !== $view->model) { + $sameScope = true; if (ClassRegistry::isKeySet($view->model)) { $modelObj =& ClassRegistry::getObject($view->model); for ($i = 0; $i < count($parts); $i++) { if ($modelObj->hasField($parts[$i]) || array_key_exists($parts[$i], $modelObj->validate)) { - $sameScope = true; $hasField = $i; break; } @@ -342,10 +342,10 @@ class Helper extends Overloadable { } if (ClassRegistry::isKeySet($parts[0])) { + $sameScope = false; $newModelObj =& ClassRegistry::getObject($parts[0]); for ($i = 1; $i < count($parts); $i++) { if ($newModelObj->hasField($parts[$i]) || array_key_exists($parts[$i], $newModelObj->validate)) { - $sameScope = false; $hasField = $i; break; } diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index 8241cb085..3c477d008 100644 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -134,7 +134,7 @@ class FormHelper extends AppHelper { 'validates' => (ife(empty($object->validate), array(), array_keys($object->validate))) ); } - + if (isset($this->data[$model]) && isset($this->data[$model][$data['key']]) && !empty($this->data[$model][$data['key']])) { $created = true; $id = $this->data[$model][$data['key']]; @@ -512,7 +512,7 @@ class FormHelper extends AppHelper { } } } - + if ($this->model() === $this->field()) { $options['type'] = 'select'; $options['multiple'] = 'multiple';