From 9b18367fcc244e77f3591adc66792984bf8340df Mon Sep 17 00:00:00 2001 From: dho Date: Wed, 2 May 2007 12:56:51 +0000 Subject: [PATCH] Fixing problem with submit options in FormHelper::end() (ticket #2516) git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4987 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/view/helpers/form.php | 6 +++--- cake/tests/cases/libs/view/helpers/form.test.php | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index 69d8c676b..f379c8438 100644 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -214,9 +214,9 @@ class FormHelper extends AppHelper { $submitOptions = $options['submit']; unset($options['submit']); - if(isset($submitOptions['label'])) { - $submit = $submitOptions['label']; - unset($submitOptions['label']); + if(isset($options['label'])) { + $submitOptions = $options['label']; + unset($options['label']); } } diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index 5757f748a..fa967fe9d 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -641,6 +641,9 @@ class FormHelperTest extends CakeTestCase { function testFormEnd() { $this->assertEqual($this->Form->end(), ''); + + $result = $this->Form->end(array('submit' => 'save')); + $this->assertEqual($result, '
'); } function tearDown() {