Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'hotfix/4582'

Close #4582
  • Loading branch information...
commit 32f4669239da654589024c029840b608fe3427c5 2 parents 0ee38e3 + 92c625d
@weierophinney weierophinney authored
Showing with 18 additions and 1 deletion.
  1. +3 −1 library/Zend/Form/Form.php
  2. +15 −0 tests/ZendTest/Form/FormTest.php
View
4 library/Zend/Form/Form.php
@@ -177,7 +177,9 @@ public function prepare()
$this->prepareElement($this);
} else {
foreach ($this->getIterator() as $elementOrFieldset) {
- if ($elementOrFieldset instanceof ElementPrepareAwareInterface) {
+ if ($elementOrFieldset instanceof FormInterface) {
+ $elementOrFieldset->prepare();
+ } elseif ($elementOrFieldset instanceof ElementPrepareAwareInterface) {
$elementOrFieldset->prepareElement($this);
}
}
View
15 tests/ZendTest/Form/FormTest.php
@@ -1527,4 +1527,19 @@ public function testAddRemove()
$this->form->remove('file_resource');
$this->assertEquals($form, $this->form);
}
+
+ public function testNestedFormElementNameWrapping()
+ {
+ //build form
+ $rootForm = new Form;
+ $leafForm = new Form('form');
+ $element = new Element('element');
+ $leafForm->setWrapElements(true);
+ $leafForm->add($element);
+ $rootForm->add($leafForm);
+
+ //prepare for view
+ $rootForm->prepare();
+ $this->assertEquals('form[element]', $element->getName());
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.