fix mail app gives "404 Not found" when clicking on link of pdf or xml files

This commit is contained in:
ralf 2025-01-09 11:33:24 +01:00
parent 27e7a96598
commit 242673fb33
2 changed files with 4 additions and 8 deletions

View File

@ -2635,7 +2635,7 @@ $filter['before']= date("d-M-Y", $cutoffdate2);
break;
}
// we either use mime_data for server-side supported mime-types or mime_url for client-side or download
if (empty($attachmentHTML[$key]['mime_data']))
if (empty($attachmentHTML[$key]['mime_data']) || preg_match('#^(application|text)/xml$#i', $attachmentHTML[$key]['type']))
{
$attachmentHTML[$key]['mime_url'] = Egw::link('/index.php',$linkData);
@ -2643,13 +2643,10 @@ $filter['before']= date("d-M-Y", $cutoffdate2);
if (Link::get_mime_info($attachmentHTML[$key]['type'],
!empty($GLOBALS['egw_info']['user']['apps']['invoices']) ? 'invoices' : 'stylite'))
{
$attachmentHTML[$key]['mime_data'] = Link::set_data($value['mimeType'], 'EGroupware\\Api\\Mail::getAttachmentAccount',
$attachmentHTML[$key]['invoice_data'] = Link::set_data($value['mimeType'], 'EGroupware\\Api\\Mail::getAttachmentAccount',
[$acc_id, $mailbox, $uid, $value['partID'], $value['is_winmail'] ?? false, true], true);
}
else
{
unset($attachmentHTML[$key]['mime_data']);
}
unset($attachmentHTML[$key]['mime_data']);
}
$attachmentHTML[$key]['windowName'] = $windowName;

View File

@ -3376,8 +3376,7 @@ app.classes.mail = AppJS.extend(
});
break;
case 'invoices':
default:
egw.open_link(attachments[row_id].mime_data, '_blank', '', action, true, attachments[row_id].type);
egw.open_link(attachments[row_id].invoice_data, '_blank', '', action, true, attachments[row_id].type);
break;
}
},