From 6ad477a08cc72e0f22b6e90be32e45d2ed7390d7 Mon Sep 17 00:00:00 2001 From: Alex Ludwig Date: Sun, 1 Mar 2020 17:14:31 +0100 Subject: [PATCH] Resolve Error if dolibarr is running in docker container If dolibarr is running in docker containers with alpine-linux it will fail because it has wrong environment variables. This pull request resolve the issue. It was found by dolichicken in the german user forum: https://www.dolibarr.de/forum/howto-hilfe/52509-anleitung-odt-nach-pdf-konvertieren#57583 --- htdocs/includes/odtphp/odf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php index 01c3310a3f8..3a5dc9feeb2 100644 --- a/htdocs/includes/odtphp/odf.php +++ b/htdocs/includes/odtphp/odf.php @@ -584,7 +584,7 @@ IMG; // using windows libreoffice that must be in path // using linux/mac libreoffice that must be in path // Note PHP Config "fastcgi.impersonate=0" must set to 0 - Default is 1 - $command ='soffice --headless --convert-to pdf --outdir '. escapeshellarg(dirname($name)). " ".escapeshellarg($name); + $command ='soffice --headless -env:UserInstallation=file:///tmp/nobody --convert-to pdf --outdir '. escapeshellarg(dirname($name)). " ".escapeshellarg($name); } elseif (preg_match('/unoconv/', $conf->global->MAIN_ODT_AS_PDF)) {