Fix select for old input

This commit is contained in:
Vendin committed 2017-06-26 17:50:42 +03:00
1 parent 9b8f51e7a2
commit 0c1a869f4c
2 files changed
+13 -1

No files matched your search

+1 -1
View File
@@ -760,7 +760,7 @@ class FormBuilder
protected function getSelectedValue($value, $selected)
{
if (is_array($selected)) {
return in_array($value, $selected, true) ? 'selected' : null;
return in_array($value, $selected, true) || in_array((string) $value, $selected, true) ? 'selected' : null;
} elseif ($selected instanceof Collection) {
return $selected->contains($value) ? 'selected' : null;
}