diff --git a/api/src/Entity/ObjectEntity.php b/api/src/Entity/ObjectEntity.php index 878a0308a..4ec81305d 100644 --- a/api/src/Entity/ObjectEntity.php +++ b/api/src/Entity/ObjectEntity.php @@ -337,7 +337,7 @@ public function getSelf(): ?string // Add path item to self uri foreach ($pathArray as $pathItem) { - if ($pathItem == 'id' || $pathItem == '{id}' || $pathItem == 'uuid' || $pathItem == '{uuid}') { + if ($this->getId() !== null && ($pathItem == 'id' || $pathItem == '{id}' || $pathItem == 'uuid' || $pathItem == '{uuid}')) { $idSet = true; $tempPath .= '/'.$this->getId()->toString(); } else {