diff --git a/lib/Service/ValidationService.php b/lib/Service/ValidationService.php index be1fca22..9ce35df0 100644 --- a/lib/Service/ValidationService.php +++ b/lib/Service/ValidationService.php @@ -36,7 +36,8 @@ public function __construct( * Validate a publication to the definition defined in the PublicationType. * * @param Publication $publication The publication to validate. - * @return Publication The validated publication. + * + * @return array The validated publication. * * @throws DoesNotExistException * @throws MultipleObjectsReturnedException @@ -45,6 +46,10 @@ public function __construct( */ public function validatePublication(array $publication): array { + if (isset($publication['publicationType']) === false) { + return $publication; + } + $publicationTypeId = $publication['publicationType']; $publicationType = $this->objectService->getObject(objectType: 'publicationType', id: $publicationTypeId);