Skip to content
Snippets Groups Projects
Commit 3ab021cc authored by Guillaume Heurtier's avatar Guillaume Heurtier
Browse files

FIX #17937 TIME 2:30 fix wrong attachment id when signed

parent 6370d9cd
No related branches found
No related tags found
No related merge requests found
......@@ -208,10 +208,10 @@ class EmailController
$size = null;
if (empty($attachment['original'])) {
$convertedResource = AdrModel::getDocuments([
$convertedResource = AdrModel::getAttachments([
'select' => ['docserver_id', 'path', 'filename'],
'where' => ['res_id = ?', 'type in (?)'],
'data' => [$attachment['id'], ['PDF', 'SIGN']],
'where' => ['res_id = ?', 'type = ?'],
'data' => [$attachment['id'], 'PDF'],
'orderBy' => ["type='SIGN' DESC"],
'limit' => 1
]);
......@@ -494,7 +494,7 @@ class EmailController
$signedAttachment = AttachmentModel::get([
'select' => ['res_id'],
'where' => ['origin = ?', 'status != ?', 'attachment_type = ?'],
'data' => ["{$attachment['resId']},res_attachments", 'DEL', 'signed_response']
'data' => ["{$attachmentId},res_attachments", 'DEL', 'signed_response']
]);
if (!empty($signedAttachment[0])) {
$attachmentId = $signedAttachment[0]['res_id'];
......@@ -517,7 +517,7 @@ class EmailController
}
$attachments[] = [
'id' => $attachment['res_id'],
'id' => $attachmentId,
'chrono' => $attachment['identifier'],
'label' => $attachment['title'],
'typeLabel' => $attachmentTypes[$attachment['attachment_type']]['label'],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment