refs #1692. Import Image.
testing/ogcore-api/pipeline/head This commit looks good Details

pull/26/head
Manuel Aranda Rosales 2025-03-11 17:21:11 +01:00
parent dc9e21b61e
commit 350dcd1d24
1 changed files with 6 additions and 0 deletions

View File

@ -64,6 +64,12 @@ class ImportAction extends AbstractOgRepositoryController
$this->entityManager->persist($imageEntity);
}
$imageImageRepositoryEntity = $this->entityManager->getRepository(ImageImageRepository::class)->findOneBy(['image' => $imageEntity, 'repository' => $repository]);
if ($imageImageRepositoryEntity){
throw new ValidatorException('This image already exists in this repository');
}
$imageImageRepositoryEntity = new ImageImageRepository();
$imageImageRepositoryEntity->setStatus(ImageStatus::AUX_FILES_PENDING);
$imageImageRepositoryEntity->setImage($imageEntity);