From 4a3251407f4a19c49718bde3ed5f12ba24abeffe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Oct 2016 20:46:21 +0200 Subject: [PATCH] Fix missing cache dir --- htdocs/api/admin/index.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/api/admin/index.php b/htdocs/api/admin/index.php index b867b6668c8..8142b564c1e 100644 --- a/htdocs/api/admin/index.php +++ b/htdocs/api/admin/index.php @@ -43,8 +43,16 @@ if ($action == 'setproductionmode') if (dolibarr_set_const($db, 'API_PRODUCTION_MODE', $status, 'chaine', 0, '', $conf->entity) > 0) { - header("Location: ".$_SERVER["PHP_SELF"]); - exit; + $result = dol_mkdir($conf->api->dir_temp); + if ($result < 0) + { + setEventMessages($langs->trans("ErrorFaildToCreateDir", $conf->api->dir_temp), null, 'errors'); + } + else + { + header("Location: ".$_SERVER["PHP_SELF"]); + exit; + } } else {