From aeaeb97a49b0cd893466327630ed3dbddc01c387 Mon Sep 17 00:00:00 2001 From: gwoo Date: Thu, 10 Jan 2008 18:50:31 +0000 Subject: [PATCH] updating helpers for multiple records, fixes #3874 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6356 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/view/helper.php | 2 +- cake/libs/view/helpers/form.php | 2 +- cake/tests/cases/libs/view/helpers/form.test.php | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/cake/libs/view/helper.php b/cake/libs/view/helper.php index 9fa964cba..6207c8529 100644 --- a/cake/libs/view/helper.php +++ b/cake/libs/view/helper.php @@ -466,7 +466,7 @@ class Helper extends Overloadable { return $this->domId(); } - $dom = $this->model() . Inflector::camelize($view->field) . Inflector::camelize($view->fieldSuffix); + $dom = $this->model() . $this->modelID() . Inflector::camelize($view->field) . Inflector::camelize($view->fieldSuffix); if (is_array($options) && !array_key_exists($id, $options)) { $options[$id] = $dom; diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index 1e369a5e2..07684c3e8 100644 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -610,7 +610,7 @@ class FormHelper extends AppHelper { if (isset($options['id'])) { $labelAttributes = array_merge($labelAttributes, array('for' => $options['id'])); } - $out = $this->label(null, $labelText, $labelAttributes); + $out = $this->label($fieldName, $labelText, $labelAttributes); } $error = null; diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index added51b0..8e86eaa79 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -1455,6 +1455,20 @@ class FormHelperTest extends CakeTestCase { $result = $this->Form->input('Contact.name', array('div' => false, 'id' => 'my_id', 'label' => array('for' => 'my_id'))); $this->assertPattern('/^