Skip to content

Commit

Permalink
Merge branch 'hotfix/1.0.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
turegjorup committed Nov 27, 2017
2 parents bdc5240 + 84aeee5 commit cae6fe4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Service/ValueHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,18 @@ private function getSerializedValueByType(FieldItemListInterface $field) {
$value[] = ['startDate' => $v['value'], 'endDate' => $v['end_value']];
}
break;
case 'boolean':
$valuesArray = $field->getValue();

if(1 == count($valuesArray)) {
$value = $valuesArray[0]['value'] ? true : false;
} elseif (1 < count($valuesArray)) {
$value = [];
foreach ($valuesArray as $v) {
$value[] = $v['value'] ? true : false;
}
}
break;
default:
$valuesArray = $field->getValue();

Expand Down

0 comments on commit cae6fe4

Please sign in to comment.