[Form] Repeat preferred choices in the main list

This commit is contained in:
Sébastien ALFAIATE 2017-07-27 11:03:55 +02:00 committed by Christian Flothmann
parent 7dfc97be9f
commit b946b11d5a

View File

@ -157,9 +157,9 @@ class DefaultChoiceListFactory implements ChoiceListFactoryInterface
if ($isPreferred && false !== $preferredKey = $isPreferred($choice, $key, $value)) {
$preferredViews[$nextIndex] = $view;
$preferredViewsOrder[$nextIndex] = $preferredKey;
} else {
$otherViews[$nextIndex] = $view;
}
$otherViews[$nextIndex] = $view;
}
private static function addChoiceViewsFromStructuredValues($values, $label, $choices, $keys, &$index, $attr, $isPreferred, &$preferredViews, &$preferredViewsOrder, &$otherViews)