Browse Source

[Form] PropertyPathMapper now only maps if the form data is synchronized to avoid duplicate form errors ('invalid'+'NotNull', for example)

Bernhard Schussek 14 years ago
parent
commit
0ace068a52
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/Symfony/Component/Form/DataMapper/PropertyPathMapper.php

+ 1 - 1
src/Symfony/Component/Form/DataMapper/PropertyPathMapper.php

@@ -91,7 +91,7 @@ class PropertyPathMapper implements DataMapperInterface
 
 
     public function mapFormToData(FormInterface $form, &$data)
     public function mapFormToData(FormInterface $form, &$data)
     {
     {
-        if ($form->getAttribute('property_path') !== null) {
+        if ($form->getAttribute('property_path') !== null && $form->isSynchronized()) {
             $propertyPath = $form->getAttribute('property_path');
             $propertyPath = $form->getAttribute('property_path');
 
 
             // If the data is identical to the value in $data, we are
             // If the data is identical to the value in $data, we are