Merge branch '2.7' into 2.8
* 2.7: Require symfony/intl ~2.4 when Locale::setDefault() is used [Form][2.7][ Choice type] fixed groups with empty array. Conflicts: src/Symfony/Component/Form/composer.json src/Symfony/Component/Translation/composer.json src/Symfony/Component/Validator/composer.json
This commit is contained in:
commit
d76cc03382
@ -172,6 +172,10 @@ class DefaultChoiceListFactory implements ChoiceListFactoryInterface
|
|||||||
private static function addChoiceViewsGroupedBy($groupBy, $label, $choices, $keys, &$index, $attr, $isPreferred, &$preferredViews, &$otherViews)
|
private static function addChoiceViewsGroupedBy($groupBy, $label, $choices, $keys, &$index, $attr, $isPreferred, &$preferredViews, &$otherViews)
|
||||||
{
|
{
|
||||||
foreach ($groupBy as $key => $value) {
|
foreach ($groupBy as $key => $value) {
|
||||||
|
if (null === $value) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Add the contents of groups to new ChoiceGroupView instances
|
// Add the contents of groups to new ChoiceGroupView instances
|
||||||
if (is_array($value)) {
|
if (is_array($value)) {
|
||||||
$preferredViewsForGroup = array();
|
$preferredViewsForGroup = array();
|
||||||
|
@ -536,6 +536,7 @@ class DefaultChoiceListFactoryTest extends \PHPUnit_Framework_TestCase
|
|||||||
$list = new ArrayChoiceList(array(
|
$list = new ArrayChoiceList(array(
|
||||||
'Group 1' => array('A' => $this->obj1, 'B' => $this->obj2),
|
'Group 1' => array('A' => $this->obj1, 'B' => $this->obj2),
|
||||||
'Group 2' => array('C' => $this->obj3, 'D' => $this->obj4),
|
'Group 2' => array('C' => $this->obj3, 'D' => $this->obj4),
|
||||||
|
'Group empty' => array(),
|
||||||
));
|
));
|
||||||
|
|
||||||
$view = $this->factory->createView(
|
$view = $this->factory->createView(
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.3.9",
|
"php": ">=5.3.9",
|
||||||
"symfony/event-dispatcher": "~2.1|~3.0.0",
|
"symfony/event-dispatcher": "~2.1|~3.0.0",
|
||||||
"symfony/intl": "~2.3|~3.0.0",
|
"symfony/intl": "~2.4|~3.0.0",
|
||||||
"symfony/options-resolver": "~2.6",
|
"symfony/options-resolver": "~2.6",
|
||||||
"symfony/property-access": "~2.3|~3.0.0"
|
"symfony/property-access": "~2.3|~3.0.0"
|
||||||
},
|
},
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
"require-dev": {
|
"require-dev": {
|
||||||
"symfony/phpunit-bridge": "~2.7|~3.0.0",
|
"symfony/phpunit-bridge": "~2.7|~3.0.0",
|
||||||
"symfony/config": "~2.7",
|
"symfony/config": "~2.7",
|
||||||
"symfony/intl": "~2.3|~3.0.0",
|
"symfony/intl": "~2.4|~3.0.0",
|
||||||
"symfony/yaml": "~2.2|~3.0.0",
|
"symfony/yaml": "~2.2|~3.0.0",
|
||||||
"psr/log": "~1.0"
|
"psr/log": "~1.0"
|
||||||
},
|
},
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
"require-dev": {
|
"require-dev": {
|
||||||
"symfony/phpunit-bridge": "~2.7|~3.0.0",
|
"symfony/phpunit-bridge": "~2.7|~3.0.0",
|
||||||
"symfony/http-foundation": "~2.1|~3.0.0",
|
"symfony/http-foundation": "~2.1|~3.0.0",
|
||||||
"symfony/intl": "~2.3|~3.0.0",
|
"symfony/intl": "~2.4|~3.0.0",
|
||||||
"symfony/yaml": "~2.0,>=2.0.5|~3.0.0",
|
"symfony/yaml": "~2.0,>=2.0.5|~3.0.0",
|
||||||
"symfony/config": "~2.2|~3.0.0",
|
"symfony/config": "~2.2|~3.0.0",
|
||||||
"symfony/property-access": "~2.3|~3.0.0",
|
"symfony/property-access": "~2.3|~3.0.0",
|
||||||
|
Reference in New Issue
Block a user