Debug v23

This commit is contained in:
Laurent Destailleur
2025-12-04 14:00:34 +01:00
parent e329c11e82
commit 39e200eb50
4 changed files with 44 additions and 30 deletions

View File

@@ -12698,7 +12698,6 @@ function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type,
function printCommonFooter($zone = 'private')
{
global $conf, $hookmanager, $user, $langs;
global $debugbar;
global $action;
global $micro_start_time;
@@ -12712,8 +12711,9 @@ function printCommonFooter($zone = 'private')
print "\n<!-- A div to store page_y POST parameter -->\n";
print '<div id="page_y" style="display: none;">' . (GETPOST('page_y') ? GETPOST('page_y') : '') . '</div>' . "\n";
$parameters = array();
$reshook = $hookmanager->executeHooks('printCommonFooter', $parameters); // Note that $action and $object may have been modified by some hooks
$parameters = array('zone' => $zone);
$tmpobject = null;
$reshook = $hookmanager->executeHooks('printCommonFooter', $parameters, $tmpobject, $action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook)) {
if (getDolGlobalString('MAIN_HTML_FOOTER')) {
print getDolGlobalString('MAIN_HTML_FOOTER') . "\n";
@@ -12907,7 +12907,7 @@ function printCommonFooter($zone = 'private')
print "\n" . '</script>' . "\n";
// Google Analytics
// TODO Add a hook here
// TODO Remove this, can be replaced with the hook printCommonFooter
if (isModEnabled('google') && getDolGlobalString('MAIN_GOOGLE_AN_ID')) {
$tmptagarray = explode(',', getDolGlobalString('MAIN_GOOGLE_AN_ID'));
foreach ($tmptagarray as $tmptag) {
@@ -12933,15 +12933,23 @@ function printCommonFooter($zone = 'private')
print_r(xdebug_get_code_coverage());
}
// Output string from hooks
if (!empty($hookmanager->resPrint)) {
print $hookmanager->resPrint;
}
// Add DebugBar data
if ($user->hasRight('debugbar', 'read') && $debugbar instanceof DebugBar\DebugBar) {
if (isset($debugbar['time'])) {
// @phan-suppress-next-line PhanPluginUnknownObjectMethodCall
$debugbar['time']->stopMeasure('pageaftermaster');
if ($user->hasRight('debugbar', 'read')) {
global $debugbar;
if ($debugbar instanceof DebugBar\DebugBar) {
if (isset($debugbar['time'])) {
// @phan-suppress-next-line PhanPluginUnknownObjectMethodCall
$debugbar['time']->stopMeasure('pageaftermaster');
}
print '<!-- Output debugbar data -->' . "\n";
$renderer = $debugbar->getJavascriptRenderer();
print $renderer->render();
}
print '<!-- Output debugbar data -->' . "\n";
$renderer = $debugbar->getJavascriptRenderer();
print $renderer->render();
} elseif (count($conf->logbuffer)) { // If there is some logs in buffer to show
print "\n";
print "<!-- Start of log output\n";