From 070b17f397e119cb7dd26a9758de31a3cc5bc859 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Sep 2024 18:27:46 +0200 Subject: [PATCH] Fix error management. --- htdocs/main.inc.php | 2 +- htdocs/modulebuilder/index.php | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 55ef7eebb06..5088fff116c 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -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 ''."\n"; diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 1dc1efac460..6de36de6d5c 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -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 */