Fix error management of website module
This commit is contained in:
parent
6b38b320bc
commit
0dc88fe9ba
1 changed files with 9 additions and 6 deletions
|
|
@ -67,8 +67,9 @@ function dolSavePageAlias($filealias, $object, $objectpage)
|
|||
$aliascontent = '<?php'."\n";
|
||||
$aliascontent .= "// File generated to wrap the alias page - DO NOT MODIFY - It is just a wrapper to real page\n";
|
||||
$aliascontent .= 'global $dolibarr_main_data_root;'."\n";
|
||||
$aliascontent .= 'if (empty($dolibarr_main_data_root)) require \'./page'.$objectpage->id.'.tpl.php\'; ';
|
||||
$aliascontent .= 'else require $dolibarr_main_data_root.\'/website/\'.$website->ref.\'/page'.$objectpage->id.'.tpl.php\';'."\n";
|
||||
$aliascontent .= 'if (empty($dolibarr_main_data_root)) $res=include \'./page'.$objectpage->id.'.tpl.php\'; ';
|
||||
$aliascontent .= 'else $res=include $dolibarr_main_data_root.\'/website/\'.$website->ref.\'/page'.$objectpage->id.'.tpl.php\';'."\n";
|
||||
$aliascontent .= 'if ($res === false) { http_response_code(500); print \'Failed to make include\'; }'."\n";
|
||||
$aliascontent .= '?>'."\n";
|
||||
$result = file_put_contents($filealias, $aliascontent);
|
||||
if ($result === false) {
|
||||
|
|
@ -87,8 +88,9 @@ function dolSavePageAlias($filealias, $object, $objectpage)
|
|||
$aliascontent = '<?php'."\n";
|
||||
$aliascontent .= "// File generated to wrap the alias page - DO NOT MODIFY - It is just a wrapper to real page\n";
|
||||
$aliascontent .= 'global $dolibarr_main_data_root;'."\n";
|
||||
$aliascontent .= 'if (empty($dolibarr_main_data_root)) require \'../page'.$objectpage->id.'.tpl.php\'; ';
|
||||
$aliascontent .= 'else require $dolibarr_main_data_root.\'/website/\'.$website->ref.\'/page'.$objectpage->id.'.tpl.php\';'."\n";
|
||||
$aliascontent .= 'if (empty($dolibarr_main_data_root)) $res=include \'../page'.$objectpage->id.'.tpl.php\'; ';
|
||||
$aliascontent .= 'else $res=include $dolibarr_main_data_root.\'/website/\'.$website->ref.\'/page'.$objectpage->id.'.tpl.php\';'."\n";
|
||||
$aliascontent .= 'if ($res === false) { http_response_code(500); print \'Failed to make include\'; }'."\n";
|
||||
$aliascontent .= '?>'."\n";
|
||||
$result = file_put_contents($filealiassub, $aliascontent);
|
||||
if ($result === false) {
|
||||
|
|
@ -110,8 +112,9 @@ function dolSavePageAlias($filealias, $object, $objectpage)
|
|||
$aliascontent = '<?php'."\n";
|
||||
$aliascontent .= "// File generated to wrap the alias page - DO NOT MODIFY - It is just a wrapper to real page\n";
|
||||
$aliascontent .= 'global $dolibarr_main_data_root;'."\n";
|
||||
$aliascontent .= 'if (empty($dolibarr_main_data_root)) require \'../page'.$objectpage->id.'.tpl.php\'; ';
|
||||
$aliascontent .= 'else require $dolibarr_main_data_root.\'/website/\'.$website->ref.\'/page'.$objectpage->id.'.tpl.php\';'."\n";
|
||||
$aliascontent .= 'if (empty($dolibarr_main_data_root)) $res=include \'../page'.$objectpage->id.'.tpl.php\'; ';
|
||||
$aliascontent .= 'else $res=include $dolibarr_main_data_root.\'/website/\'.$website->ref.\'/page'.$objectpage->id.'.tpl.php\';'."\n";
|
||||
$aliascontent .= 'if ($res === false) { http_response_code(500); print \'Failed to make include\'; }'."\n";
|
||||
$aliascontent .= '?>'."\n";
|
||||
|
||||
dol_mkdir($dirname.'/'.$sublang);
|
||||
|
|
|
|||
Loading…
Reference in a new issue