From a937fc8ef1d6bd27d4ea9c37ddb304cba11c39ef Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Mar 2020 19:49:14 +0100 Subject: [PATCH] Fix home page after first page creation --- htdocs/website/index.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 46fce8d7e74..03587b97d32 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -849,6 +849,13 @@ if ($action == 'addcontainer') { $error++; setEventMessages($object->error, $object->errors, 'errors'); + } else { + $filetpl = $pathofwebsite.'/page'.$pageid.'.tpl.php'; + + // Generate the index.php page to be the home page + $result = dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper); + + if ($result <= 0) setEventMessages('Failed to write file '.$fileindex, null, 'errors'); } } } @@ -1327,8 +1334,9 @@ if ($action == 'setashome') { $db->commit(); + $filetpl = $pathofwebsite.'/page'.$pageid.'.tpl.php'; + // Generate the index.php page to be the home page - //------------------------------------------------- $result = dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper); if ($result) setEventMessages($langs->trans("Saved"), null, 'mesgs');