From 39f2ec83d517de8f9b5fc25aa4fcef6ea60a8633 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Mon, 16 Nov 2020 13:35:53 +0200 Subject: [PATCH] fix duplicate attachments multiple --- application/Espo/Services/Record.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/Espo/Services/Record.php b/application/Espo/Services/Record.php index c751b7974a..acaeaf5f14 100644 --- a/application/Espo/Services/Record.php +++ b/application/Espo/Services/Record.php @@ -2550,6 +2550,10 @@ class Record implements Crud, ->getRepository('Attachment') ->getCopiedAttachment($attachment); + $attachment->set('field', $field); + + $this->getEntityManager()->saveEntity($attachment); + if ($attachment) { $idList[] = $attachment->id; $nameHash->{$attachment->id} = $attachment->get('name');