Fix home page after first page creation

This commit is contained in:
Laurent Destailleur 2020-03-09 19:49:14 +01:00
parent 99b1c773a7
commit b81c02de04

View File

@ -841,6 +841,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');
}
}
}
@ -1312,8 +1319,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');