bug #21481 [Form] Fixed empty conversion of Intl types (HeahDude)

This PR was merged into the 3.2 branch.

Discussion
----------

[Form] Fixed empty conversion of Intl types

| Q             | A
| ------------- | ---
| Branch?       | 3.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #20759, #21475
| License       | MIT
| Doc PR        | ~

Commits
-------

e43bfafbcc [Form] Fixed empty conversion of Intl types
This commit is contained in:
Fabien Potencier 2017-03-05 10:16:12 -08:00
commit 16263fb04d
5 changed files with 10 additions and 0 deletions

View File

@ -75,6 +75,7 @@ class CountryType extends AbstractType implements ChoiceLoaderInterface
public function loadChoicesForValues(array $values, $value = null)
{
// Optimize
$values = array_filter($values);
if (empty($values)) {
return array();
}
@ -93,6 +94,7 @@ class CountryType extends AbstractType implements ChoiceLoaderInterface
public function loadValuesForChoices(array $choices, $value = null)
{
// Optimize
$choices = array_filter($choices);
if (empty($choices)) {
return array();
}

View File

@ -75,6 +75,7 @@ class CurrencyType extends AbstractType implements ChoiceLoaderInterface
public function loadChoicesForValues(array $values, $value = null)
{
// Optimize
$values = array_filter($values);
if (empty($values)) {
return array();
}
@ -93,6 +94,7 @@ class CurrencyType extends AbstractType implements ChoiceLoaderInterface
public function loadValuesForChoices(array $choices, $value = null)
{
// Optimize
$choices = array_filter($choices);
if (empty($choices)) {
return array();
}

View File

@ -75,6 +75,7 @@ class LanguageType extends AbstractType implements ChoiceLoaderInterface
public function loadChoicesForValues(array $values, $value = null)
{
// Optimize
$values = array_filter($values);
if (empty($values)) {
return array();
}
@ -93,6 +94,7 @@ class LanguageType extends AbstractType implements ChoiceLoaderInterface
public function loadValuesForChoices(array $choices, $value = null)
{
// Optimize
$choices = array_filter($choices);
if (empty($choices)) {
return array();
}

View File

@ -75,6 +75,7 @@ class LocaleType extends AbstractType implements ChoiceLoaderInterface
public function loadChoicesForValues(array $values, $value = null)
{
// Optimize
$values = array_filter($values);
if (empty($values)) {
return array();
}
@ -93,6 +94,7 @@ class LocaleType extends AbstractType implements ChoiceLoaderInterface
public function loadValuesForChoices(array $choices, $value = null)
{
// Optimize
$choices = array_filter($choices);
if (empty($choices)) {
return array();
}

View File

@ -72,6 +72,7 @@ class TimezoneType extends AbstractType implements ChoiceLoaderInterface
public function loadChoicesForValues(array $values, $value = null)
{
// Optimize
$values = array_filter($values);
if (empty($values)) {
return array();
}
@ -90,6 +91,7 @@ class TimezoneType extends AbstractType implements ChoiceLoaderInterface
public function loadValuesForChoices(array $choices, $value = null)
{
// Optimize
$choices = array_filter($choices);
if (empty($choices)) {
return array();
}