mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-16 07:47:57 +02:00
Remove preview image attachment during if the attachment got deleted during cloning
This fixes issue #559
This commit is contained in:
parent
a792a140f7
commit
945fb9384e
2 changed files with 21 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue