From 2f1ab1a003dbf0f3f733cca6eff79b4bb1e377de Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Jul 2022 14:31:28 +0200 Subject: [PATCH] Fix detection of version --- htdocs/install/check.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/install/check.php b/htdocs/install/check.php index a4e7c59ace7..7e21909bb06 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -454,11 +454,12 @@ if (!file_exists($conffile)) { $migrationscript = array(); $handle = opendir($dir); if (is_resource($handle)) { + $versiontousetoqualifyscript = preg_replace('/-.*/', '', DOL_VERSION); while (($file = readdir($handle)) !== false) { $reg = array(); if (preg_match('/^(\d+\.\d+\.\d+)-(\d+\.\d+\.\d+)\.sql$/i', $file, $reg)) { - //var_dump(DOL_VERSION." ".$reg[2]." ".version_compare(DOL_VERSION, $reg[2])); - if (!empty($reg[2]) && version_compare(DOL_VERSION, $reg[2]) >= 0) { + //var_dump(DOL_VERSION." ".$reg[2]." ".$versiontousetoqualifyscript." ".version_compare($versiontousetoqualifyscript, $reg[2])); + if (!empty($reg[2]) && version_compare($versiontousetoqualifyscript, $reg[2]) >= 0) { $migrationscript[] = array('from' => $reg[1], 'to' => $reg[2]); } }