diff --git a/src/GraphQL/DataObjectInputProcessor/QuantityValue.php b/src/GraphQL/DataObjectInputProcessor/QuantityValue.php index 2b9831c7..090bcae8 100644 --- a/src/GraphQL/DataObjectInputProcessor/QuantityValue.php +++ b/src/GraphQL/DataObjectInputProcessor/QuantityValue.php @@ -35,13 +35,17 @@ public function process($object, $newValue, $args, $context, ResolveInfo $info) $attribute = $this->getAttribute(); Service::setValue($object, $attribute, function ($container, $setter) use ($newValue) { if ($newValue) { + $value = null; $unit = null; + if (isset($newValue['value'])) { + $value = $newValue['value']; + } if (isset($newValue['unitId'])) { $unit = \Pimcore\Model\DataObject\QuantityValue\Unit::getById($newValue['unitId']); } elseif (isset($newValue['unit'])) { $unit = \Pimcore\Model\DataObject\QuantityValue\Unit::getByAbbreviation($newValue['unit']); } - $quantityValue = new \Pimcore\Model\DataObject\Data\QuantityValue($newValue['value'], $unit); + $quantityValue = new \Pimcore\Model\DataObject\Data\QuantityValue($value, $unit); return $container->$setter($quantityValue); }