Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d685d7d

Browse filesBrowse files
feldsfabpot
authored andcommitted
Cast the group name as a string
This allows the options to be grouped by association fields.
1 parent fb2ce7a commit d685d7d
Copy full SHA for d685d7d

File tree

Expand file treeCollapse file tree

1 file changed

+5
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-3
lines changed

‎src/Symfony/Component/Form/Extension/Core/ChoiceList/ObjectChoiceList.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/ChoiceList/ObjectChoiceList.php
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,13 @@ protected function initialize($choices, array $labels, array $preferredChoices)
128128
if (null === $group) {
129129
$groupedChoices[$i] = $choice;
130130
} else {
131-
if (!isset($groupedChoices[$group])) {
132-
$groupedChoices[$group] = array();
131+
$groupName = (string) $group;
132+
133+
if (!isset($groupedChoices[$groupName])) {
134+
$groupedChoices[$groupName] = array();
133135
}
134136

135-
$groupedChoices[$group][$i] = $choice;
137+
$groupedChoices[$groupName][$i] = $choice;
136138
}
137139
}
138140

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.