From 0de06b7ef4ca24852fcf09c68916012ff7645d9f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Jan 2021 16:49:54 +0100 Subject: [PATCH] Fix odttopdf generation --- htdocs/includes/odtphp/odf.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php index 7b165b53142..0f5861caf68 100644 --- a/htdocs/includes/odtphp/odf.php +++ b/htdocs/includes/odtphp/odf.php @@ -821,7 +821,10 @@ IMG; if ($conf->global->MAIN_ODT_AS_PDF == 'libreoffice') { dol_mkdir($conf->user->dir_temp); // We must be sure the directory exists and is writable - dol_mkdir($conf->user->dir_temp.'/odtaspdf'); // We create a subdir because the soffice change pemrissions on it + + // We delete and recreate a subdir because the soffice may have change pemrissions on it + dol_delete_dir_recursive($conf->user->dir_temp.'/odtaspdf'); + dol_mkdir($conf->user->dir_temp.'/odtaspdf'); // Install prerequisites: apt install soffice libreoffice-common libreoffice-writer // using windows libreoffice that must be in path