From 9e982e05df08576c78300e8761407543f903ffe8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Sep 2018 22:58:20 +0200 Subject: [PATCH] Fix import --- htdocs/website/class/website.class.php | 4 ++++ htdocs/website/index.php | 15 +-------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index ffdd091ea71..68cf5e8c293 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -971,6 +971,10 @@ class Website extends CommonObject dolCopyDir($conf->website->dir_temp.'/'.$object->ref.'/containers', $conf->website->dir_output.'/'.$object->ref, 0, 1); // Overwrite if exists + // Now generate the master.inc.php page + $filemaster=$conf->website->dir_output.'/'.$object->ref.'/master.inc.php'; + dolSaveMasterFile($filemaster); + dolCopyDir($conf->website->dir_temp.'/'.$object->ref.'/medias/image/websitekey', $conf->website->dir_output.'/'.$object->ref.'/medias/image/'.$object->ref, 0, 1); // Medias can be shared, do not overwrite if exists dolCopyDir($conf->website->dir_temp.'/'.$object->ref.'/medias/js/websitekey', $conf->website->dir_output.'/'.$object->ref.'/medias/js/'.$object->ref, 0, 1); // Medias can be shared, do not overwrite if exists diff --git a/htdocs/website/index.php b/htdocs/website/index.php index e42a54e4904..6641620ba84 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -1134,20 +1134,7 @@ if ($action == 'updatemeta') // Now generate the master.inc.php page - dol_syslog("We regenerate the master file (because we update meta)"); - dol_delete_file($filemaster); - - $mastercontent = ''."\n"; - $result = file_put_contents($filemaster, $mastercontent); - if (! empty($conf->global->MAIN_UMASK)) - @chmod($filemaster, octdec($conf->global->MAIN_UMASK)); - - if (! $result) setEventMessages('Failed to write file '.$filemaster, null, 'errors'); + dolSaveMasterFile($filemaster); // Now delete the alias.php page if (! empty($fileoldalias))