mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-27 09:09:04 +01:00
Merge as PDF:
- improve error logging - remove original merge result when PDF conversion succeeds
This commit is contained in:
parent
89923e25c4
commit
fb88f8846b
@ -2409,7 +2409,7 @@ abstract class Merge
|
||||
|
||||
if(($error = $document_merge->check_document($_REQUEST['document'],'')))
|
||||
{
|
||||
$response->error($error);
|
||||
error_log(__METHOD__ . "({$_REQUEST['document']}) $error");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2466,8 +2466,20 @@ abstract class Merge
|
||||
if($editable_mimes[Vfs::mime_content_type($target)] && $pdf)
|
||||
{
|
||||
$error = '';
|
||||
$converted_path = '';
|
||||
$convert = new Conversion();
|
||||
$convert->convert($target, $target, 'pdf', $error);
|
||||
$convert->convert($target, $converted_path, 'pdf', $error);
|
||||
|
||||
if($error)
|
||||
{
|
||||
error_log(__METHOD__ . "({$_REQUEST['document']}) $target => $converted_path Error in PDF conversion: $error");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Remove original
|
||||
Vfs::unlink($target);
|
||||
$target = $converted_path;
|
||||
}
|
||||
}
|
||||
if($editable_mimes[Vfs::mime_content_type($target)] &&
|
||||
!in_array(Vfs::mime_content_type($target), explode(',', $GLOBALS['egw_info']['user']['preferences']['filemanager']['collab_excluded_mimes'])))
|
||||
|
Loading…
Reference in New Issue
Block a user