diff --git a/src/Services/ImportExportSystem/PartKeeprImporter/PKImportHelperTrait.php b/src/Services/ImportExportSystem/PartKeeprImporter/PKImportHelperTrait.php index 1e4cd3ba..64127341 100644 --- a/src/Services/ImportExportSystem/PartKeeprImporter/PKImportHelperTrait.php +++ b/src/Services/ImportExportSystem/PartKeeprImporter/PKImportHelperTrait.php @@ -150,6 +150,11 @@ trait PKImportHelperTrait $target->addAttachment($attachment); $this->em->persist($attachment); + + //If the attachment is an image, and the target has no master picture yet, set it + if ($attachment->isPicture() && $target->getMasterPictureAttachment() === null) { + $target->setMasterPictureAttachment($attachment); + } } $this->em->flush();