Skip to content
Code-Schnipsel Gruppen Projekte
Commit 767b4021 erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

Merge branch 'next-3.x' into 'main'

fix(Send ERP Mail): uncaught error: call to a member function getMedia() on null

See merge request !153
Übergeordnete a269d736 fefe2cad
No related branches found
Tags 3.7.19
2 Merge Requests!153fix(Send ERP Mail): uncaught error: call to a member function getMedia() on null,!140Update 'next-4.x' with latest changes from 'main'
Pipeline #12424 mit Warnungen bestanden mit Phase
in 55 Sekunden
...@@ -48,18 +48,26 @@ function ( ...@@ -48,18 +48,26 @@ function (
!empty($mailAttachmentMediaFileIds) && !empty($mailAttachmentMediaFileIds) &&
Permission::hasPermission(ERPOutput::PERMISSION_ATTACH_EMAIL_FILES) Permission::hasPermission(ERPOutput::PERMISSION_ATTACH_EMAIL_FILES)
) { ) {
$Media = QUI::getRewrite()->getProject()->getMedia(); $Project = QUI::getRewrite()->getProject();
$mailAttachmentMediaFileIds = json_decode($mailAttachmentMediaFileIds, true);
foreach ($mailAttachmentMediaFileIds as $fileId) { if ($Project) {
if (empty($fileId)) { $Project = QUI::getProjectManager()->getStandard();
continue; }
}
if ($Project) {
$Media = $Project->getMedia();
$mailAttachmentMediaFileIds = json_decode($mailAttachmentMediaFileIds, true);
foreach ($mailAttachmentMediaFileIds as $fileId) {
if (empty($fileId)) {
continue;
}
try { try {
$attachedMediaFiles[] = $Media->get((int)$fileId); $attachedMediaFiles[] = $Media->get((int)$fileId);
} catch (Exception $Exception) { } catch (Exception $Exception) {
QUI\System\Log::writeException($Exception); QUI\System\Log::writeException($Exception);
}
} }
} }
} }
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren