Skip to content
Snippets Groups Projects
Commit 07f9c2ad authored by jaapjansma's avatar jaapjansma
Browse files

update

parent a8b29ad9
No related branches found
No related tags found
No related merge requests found
......@@ -100,6 +100,15 @@ class OptionGroupType extends AbstractType implements OptionListInterface {
public function normalizeValue($value) {
$this->loadOptions();
$multiple = $this->configuration->get('multiple') ? true : false;
// Correct array values when field is not multiple.
// this could be caused for example by a drupal webform with
// a checkbox field. The value is submitted as an array, altough it contains
// only one value.
if (!$multiple && is_array($value) && count($value) == 1) {
$value = reset($value);
}
if ($multiple && is_array($value)) {
$return = array();
foreach($value as $item) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment