Skip to content

Commit b035640

Browse files
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
2 parents 6e48d21 + 49bee27 commit b035640

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

ChoiceList/Factory/DefaultChoiceListFactory.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ private static function addChoiceView($choice, $value, $label, $keys, &$index, $
172172
private static function addChoiceViewsGroupedBy($groupBy, $label, $choices, $keys, &$index, $attr, $isPreferred, &$preferredViews, &$otherViews)
173173
{
174174
foreach ($groupBy as $key => $value) {
175+
if (null === $value) {
176+
continue;
177+
}
178+
175179
// Add the contents of groups to new ChoiceGroupView instances
176180
if (is_array($value)) {
177181
$preferredViewsForGroup = array();

Tests/ChoiceList/Factory/DefaultChoiceListFactoryTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@ public function testCreateViewFlatGroupByOriginalStructure()
536536
$list = new ArrayChoiceList(array(
537537
'Group 1' => array('A' => $this->obj1, 'B' => $this->obj2),
538538
'Group 2' => array('C' => $this->obj3, 'D' => $this->obj4),
539+
'Group empty' => array(),
539540
));
540541

541542
$view = $this->factory->createView(

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"require": {
1919
"php": ">=5.3.9",
2020
"symfony/event-dispatcher": "~2.1|~3.0.0",
21-
"symfony/intl": "~2.3|~3.0.0",
21+
"symfony/intl": "~2.4|~3.0.0",
2222
"symfony/options-resolver": "~2.6",
2323
"symfony/property-access": "~2.3|~3.0.0"
2424
},

0 commit comments

Comments
 (0)