Browse files

Removed redundant form cloning in embedForm() methods

  • Loading branch information...
1 parent c27d64a commit 9ec13113d9ae4548033704d2c5c22c9c26577dda rozwell committed Mar 30, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/form/sfFormPropel.class.php
View
6 lib/form/sfFormPropel.class.php
@@ -126,7 +126,7 @@ public function addOptionalForms($taintedValues = null)
// The form must be added to the main form
while (array_key_exists($name . $i, $taintedValues))
{
- $this->embedForm($name . $i, clone $form);
+ $this->embedForm($name . $i, $form);
$this->getWidgetSchema()->moveField($name . $i, sfWidgetFormSchema::BEFORE, $name);
$i++;
}
@@ -143,7 +143,7 @@ public function addOptionalForms($taintedValues = null)
$target = $this->embeddedForms[$parent];
while (array_key_exists($name . $i, $taintedValuesCopy))
{
- $target->embedForm($name . $i, clone $form);
+ $target->embedForm($name . $i, $form);
$target->getWidgetSchema()->moveField($name . $i, sfWidgetFormSchema::BEFORE, $name);
$i++;
// the parent form schema is not updated when updating an embedded form
@@ -500,7 +500,7 @@ public function mergeForm(sfForm $form)
{
foreach ($form->getEmbeddedForms() as $name => $embeddedForm)
{
- $this->embedForm($name, clone $embeddedForm);
+ $this->embedForm($name, $embeddedForm);
}
parent::mergeForm($form);
}

0 comments on commit 9ec1311

Please sign in to comment.