From 2033b75c335b119fc6f5ded5745dac029c920b99 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 16 Jun 2022 09:17:00 +0200 Subject: [PATCH] Add option MAIN_NO_UPGRADE_REDIRECT_ON_LEVEL_3_CHANGE --- htdocs/main.inc.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 076ab0dbc6a..de14cae280b 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -480,10 +480,13 @@ if ((!empty($conf->global->MAIN_VERSION_LAST_UPGRADE) && ($conf->global->MAIN_VE $dolibarrversionlastupgrade = preg_split('/[.-]/', $versiontocompare); $dolibarrversionprogram = preg_split('/[.-]/', DOL_VERSION); $rescomp = versioncompare($dolibarrversionprogram, $dolibarrversionlastupgrade); - if ($rescomp > 0) { // Programs have a version higher than database. 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 page.", LOG_WARNING); - header("Location: ".DOL_URL_ROOT."/install/index.php"); - exit; + if ($rescomp > 0) { // Programs have a version higher than database. + if (empty($conf->global->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"); + exit; + } } }