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
No related tags found
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 (
!empty($mailAttachmentMediaFileIds) &&
Permission::hasPermission(ERPOutput::PERMISSION_ATTACH_EMAIL_FILES)
) {
$Media = QUI::getRewrite()->getProject()->getMedia();
$mailAttachmentMediaFileIds = json_decode($mailAttachmentMediaFileIds, true);
$Project = QUI::getRewrite()->getProject();
foreach ($mailAttachmentMediaFileIds as $fileId) {
if (empty($fileId)) {
continue;
}
if ($Project) {
$Project = QUI::getProjectManager()->getStandard();
}
if ($Project) {
$Media = $Project->getMedia();
$mailAttachmentMediaFileIds = json_decode($mailAttachmentMediaFileIds, true);
foreach ($mailAttachmentMediaFileIds as $fileId) {
if (empty($fileId)) {
continue;
}
try {
$attachedMediaFiles[] = $Media->get((int)$fileId);
} catch (Exception $Exception) {
QUI\System\Log::writeException($Exception);
try {
$attachedMediaFiles[] = $Media->get((int)$fileId);
} catch (Exception $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