Commit 930a746a authored by Guillaume Heurtier's avatar Guillaume Heurtier
Browse files

Merge branch 'fix/17383/develop' into 'develop'

FIX #17383 TIME 1:45 fix check if attachment is mailing when sending to maarch parapheur

See merge request maarch/MaarchCourrier!334
parents c5b17777 b3c4e440
......@@ -229,8 +229,14 @@ class MaarchParapheurController
]);
foreach ($attachments as $keyAttachment => $attachment) {
if (strpos($attachment['identifier'], '-') != false) {
$mailingIdentifier = substr($attachment['identifier'], 0, strpos($attachment['identifier'], '-'));
$mailingAttachment = AttachmentModel::get(['select' => ['res_id'], 'where' => ['identifier = ?'], 'data' =>[$mailingIdentifier]]);
$mailingIdentifier = substr($attachment['identifier'], 0, strripos($attachment['identifier'], '-'));
$mailingAttachment = AttachmentModel::get([
'select' => ['res_id'],
'where' => ['identifier = ?'],
'data' => [$mailingIdentifier],
'orderBy' => ['relation DESC'],
'limit' => 1
]);
if (!empty($mailingAttachment[0])) {
$attachments[$keyAttachment]['mailingResId'] = $mailingAttachment[0]['res_id'];
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment