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() {