Explorar el Código

merged branch weaverryan/form_choice_missing_variable (PR #2005)

Commits
-------

fdd2e7a [Form] Fixing a bug where setting empty_value to false caused a variable to not be found

Discussion
----------

[Form] Fixing a bug where setting empty_value to false caused a variable

Hey guys!

I think was an edge case that was overlooked. In this one case, the `$emptyValue` variable is never set. It causes warnings, but there should be no behavior change since the missing variable is being set to `null`.

Thanks!
Fabien Potencier hace 13 años
padre
commit
1fa6fa24cc
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php

+ 1 - 1
src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php

@@ -67,7 +67,7 @@ class ChoiceType extends AbstractType
             $emptyValue = null;
         } elseif (false === $options['empty_value']) {
             // an empty value should be added but the user decided otherwise
-            $options['empty_value'] = null;
+            $emptyValue = null;
         } elseif (null === $options['empty_value']) {
             // user did not made a decision, so we put a blank empty value
             $emptyValue = $options['required'] ? null : '';