mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-12 10:19:36 +01:00
Remove preview image attachment during if the attachment got deleted during cloning
This fixes issue #559
This commit is contained in:
@@ -312,6 +312,11 @@ class PartController extends AbstractController
|
||||
}
|
||||
}
|
||||
|
||||
//Ensure that the master picture is still part of the attachments
|
||||
if ($new_part->getMasterPictureAttachment() !== null && !$new_part->getAttachments()->contains($new_part->getMasterPictureAttachment())) {
|
||||
$new_part->setMasterPictureAttachment(null);
|
||||
}
|
||||
|
||||
$this->commentHelper->setMessage($form['log_comment']->getData());
|
||||
|
||||
$this->em->persist($new_part);
|
||||
|
||||
Reference in New Issue
Block a user