Fix error management.

This commit is contained in:
Laurent Destailleur 2024-09-05 18:27:46 +02:00
parent 07546f4d7e
commit 070b17f397
2 changed files with 6 additions and 3 deletions

View File

@ -1617,7 +1617,7 @@ if (!function_exists("llxHeader")) {
}
if (getDolGlobalString('MAIN_OPTIMIZEFORCOLORBLIND')) {
$tmpcsstouse .= ' colorblind-'.strip_tags($conf->global->MAIN_OPTIMIZEFORCOLORBLIND);
$tmpcsstouse .= ' colorblind-'.strip_tags(getDolGlobalString('MAIN_OPTIMIZEFORCOLORBLIND'));
}
print '<body id="mainbody" class="'.$tmpcsstouse.'">'."\n";

View File

@ -226,8 +226,10 @@ function moduleBuilderShutdownFunction()
if ($error && ($error['type'] & (E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR))) {
// Handle the fatal error
echo "Fatal error occurred: {$error['message']} in {$error['file']} on line {$error['line']}";
// Optionally, you can log the error or send a notification
llxFooter();
// If a header was already send, we suppose it is the llx_Header() so we call the llxFooter()
if (headers_sent()) {
llxFooter();
}
}
}
register_shutdown_function("moduleBuilderShutdownFunction");
@ -3044,6 +3046,7 @@ if ($dirins && $action == "update_props_module" && !empty(GETPOST('keydescriptio
}
}
/*
* View
*/