diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php
index baf38bd9a39..67e3022d6e3 100644
--- a/htdocs/core/db/DoliDB.class.php
+++ b/htdocs/core/db/DoliDB.class.php
@@ -201,7 +201,7 @@ abstract class DoliDB implements Database
*/
function getVersionArray()
{
- return explode('.',$this->getVersion());
+ return preg_split("/[\.,-]/",$this->getVersion());
}
/**
diff --git a/htdocs/install/check.php b/htdocs/install/check.php
index 671c3660594..70447a2a191 100644
--- a/htdocs/install/check.php
+++ b/htdocs/install/check.php
@@ -531,9 +531,11 @@ $("div#AShowChoices a").click(function() {
});
+/*
$(".runupgrade").click(function() {
return confirm("'.dol_escape_js($langs->transnoentitiesnoconv("WarningUpgrade"), 0, 1).'");
});
+*/
';
diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php
index e93b27ab6e9..3fe51cc8192 100644
--- a/htdocs/install/upgrade.php
+++ b/htdocs/install/upgrade.php
@@ -83,7 +83,7 @@ if (! $versionfrom && ! $versionto)
$sapi_type = php_sapi_name();
$script_file = basename(__FILE__);
$path=dirname(__FILE__).'/';
- if (substr($sapi_type, 0, 3) == 'cli')
+ if (substr($sapi_type, 0, 3) == 'cli')
{
print 'Syntax from command line: '.$script_file." x.y.z a.b.c\n";
}
@@ -178,7 +178,7 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action')))
print '
'.$version.' | ';
dolibarr_install_syslog("upgrade: ".$langs->transnoentities("ServerVersion")." : $version");
- // Test database version
+ // Test database version requirement
$versionmindb=$db::VERSIONMIN;
//print join('.',$versionarray).' - '.join('.',$versionmindb);
if (count($versionmindb) && count($versionarray)
@@ -190,6 +190,32 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action')))
$ok=0;
}
+ // Test database version is not forbidden for migration
+ $dbversion_disallowed=array(
+ array('type'=>'mysql','version'=>array(5,5,40)),
+ array('type'=>'mysqli','version'=>array(5,5,40)),
+ array('type'=>'mysql','version'=>array(5,5,41)),
+ array('type'=>'mysqli','version'=>array(5,5,41))
+ );
+ $listofforbiddenversion='';
+ foreach ($dbversion_disallowed as $dbversion_totest)
+ {
+ if ($dbversion_totest['type'] == $db->type) $listofforbiddenversion.=($listofforbiddenversion?', ':'').join('.',$dbversion_totest['version']);
+ }
+ foreach ($dbversion_disallowed as $dbversion_totest)
+ {
+ print $db->type.' - '.join('.',$versionarray).' - '.versioncompare($dbversion_totest['version'],$versionarray)."
\n";
+ if ($dbversion_totest['type'] == $db->type
+ && (versioncompare($dbversion_totest['version'],$versionarray) == 0 || versioncompare($dbversion_totest['version'],$versionarray)<=-4 || versioncompare($dbversion_totest['version'],$versionarray)>=4)
+ )
+ {
+ // Warning: database version too low.
+ print ''.$langs->trans("ErrorDatabaseVersionForbiddenForMigration",join('.',$versionarray),$listofforbiddenversion)." | ".$langs->trans("Error")." |
\n";
+ dolibarr_install_syslog("upgrade: ".$langs->transnoentities("ErrorDatabaseVersionForbiddenForMigration",join('.',$versionarray),$listofforbiddenversion));
+ $ok=0;
+ break;
+ }
+ }
}
// Force l'affichage de la progression
diff --git a/htdocs/langs/en_US/install.lang b/htdocs/langs/en_US/install.lang
index ef5b7e20ca6..7de123d5ea3 100644
--- a/htdocs/langs/en_US/install.lang
+++ b/htdocs/langs/en_US/install.lang
@@ -156,6 +156,7 @@ LastStepDesc=Last step: Define here login and password you plan
ActivateModule=Activate module %s
ShowEditTechnicalParameters=Click here to show/edit advanced parameters (expert mode)
WarningUpgrade=Warning:\nDid your run a database backup first ?\nThis is highly recommanded: for example, due to some bugs into databases systems (for example mysql version 5.5.40), some data or tables may be lost during this process, so it is highly recommanded to have a complete dump of your database before starting migration.\n\nClick OK to start migration process...
+ErrorDatabaseVersionForbiddenForMigration=Your database version is %s. It has a critical bug making data loss if you make structure change on your database, like it is required by the migration process. For his reason, migration will not be allowed until you upgrade your database to a higher fixed version (list of known bugged version: %s)
#########
# upgrade
diff --git a/htdocs/theme/eldy/img/menus/README.md b/htdocs/theme/eldy/img/menus/README.md
index 1b3942d1913..12cd9da537a 100644
--- a/htdocs/theme/eldy/img/menus/README.md
+++ b/htdocs/theme/eldy/img/menus/README.md
@@ -3,7 +3,7 @@ Tutorial to create a new image for menu:
1) First find an image.
2) With Gimp, open image and check there is a alpha channel. If not add one.
-3) Convert image into back and white.
+3) Convert image into back and white (Menu Image - Mode - Grey levels).
4) Use the degrade tool with option:
* Erase color
* Opacity: 50 +/-