bug #29501 [Form] filter out invalid language values (xabbuh)
This PR was merged into the 4.1 branch.
Discussion
----------
[Form] filter out invalid language values
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #23679
| License | MIT
| Doc PR |
Commits
-------
ed97568b8a
filter out invalid language values
This commit is contained in:
commit
bcee8d91ac
@ -30,11 +30,6 @@ class IntlCallbackChoiceLoader extends CallbackChoiceLoader
|
||||
return array();
|
||||
}
|
||||
|
||||
// If no callable is set, values are the same as choices
|
||||
if (null === $value) {
|
||||
return $values;
|
||||
}
|
||||
|
||||
return $this->loadChoiceList($value)->getChoicesForValues($values);
|
||||
}
|
||||
|
||||
|
@ -84,6 +84,11 @@ class IntlCallbackChoiceLoaderTest extends TestCase
|
||||
);
|
||||
}
|
||||
|
||||
public function testLoadChoicesForValuesDropsNonExistentChoices()
|
||||
{
|
||||
$this->assertSame(array(), self::$loader->loadChoicesForValues(array('foo')));
|
||||
}
|
||||
|
||||
public function testLoadValuesForChoicesLoadsChoiceListOnFirstCall()
|
||||
{
|
||||
$this->assertSame(
|
||||
|
Reference in New Issue
Block a user