From 79fc6167a957fce329f5bb381e12213d3e6071d4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 May 2024 15:31:33 +0200 Subject: [PATCH] Better message error report on CLI --- htdocs/main.inc.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index c8cbe69bbb1..8bc5cd14656 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -587,7 +587,11 @@ if ($checkifupgraderequired) { if (!getDolGlobalString('MAIN_NO_UPGRADE_REDIRECT_ON_LEVEL_3_CHANGE') || $rescomp < 3) { // We did not add "&& $rescomp < 3" because we want upgrade process for build upgrades dol_syslog("main.inc: database version ".$versiontocompare." is lower than programs version ".DOL_VERSION.". Redirect to install/upgrade page.", LOG_WARNING); - header("Location: ".DOL_URL_ROOT."/install/index.php"); + if (php_sapi_name() === "cli") { + print "main.inc: database version ".$versiontocompare." is lower than programs version ".DOL_VERSION.". Try to run upgrade process.\n"; + } else { + header("Location: ".DOL_URL_ROOT."/install/index.php"); + } exit; } }