diff --git a/src/Form/Type/SIUnitType.php b/src/Form/Type/SIUnitType.php index 3a848396..a22ba234 100644 --- a/src/Form/Type/SIUnitType.php +++ b/src/Form/Type/SIUnitType.php @@ -160,7 +160,7 @@ class SIUnitType extends AbstractType implements DataMapperInterface return null; } - $data = $this->si_formatter->convertValue($viewData); + $data = $this->si_formatter->convertValue((float) $viewData); if (isset($forms['prefix'])) { $forms['value']->setData($data['value']); diff --git a/src/Services/Attachments/AttachmentManager.php b/src/Services/Attachments/AttachmentManager.php index e898db0e..ffaac0d5 100644 --- a/src/Services/Attachments/AttachmentManager.php +++ b/src/Services/Attachments/AttachmentManager.php @@ -105,7 +105,13 @@ class AttachmentManager return false; } - return file_exists($this->toAbsoluteFilePath($attachment)) || $attachment->isExternal(); + $absolute_path = $this->toAbsoluteFilePath($attachment); + + if ($absolute_path === null) { + return false; + } + + return file_exists($absolute_path) || $attachment->isExternal(); } /**