mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-16 16:09:31 +00:00
Use image attachments as preview images for partkeepr imports
Fixes issue #1115
This commit is contained in:
parent
c60b406157
commit
39ff4f81c0
1 changed files with 5 additions and 0 deletions
|
|
@ -150,6 +150,11 @@ trait PKImportHelperTrait
|
||||||
|
|
||||||
$target->addAttachment($attachment);
|
$target->addAttachment($attachment);
|
||||||
$this->em->persist($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();
|
$this->em->flush();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue