mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
FIX Restore feature to enable a module during CLI upgrade
This commit is contained in:
parent
1fe1cb986a
commit
812687e10c
|
|
@ -313,13 +313,13 @@ script:
|
|||
php upgrade2.php 3.9.0 4.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL > $TRAVIS_BUILD_DIR/upgrade390400-2.log
|
||||
php step5.php 3.9.0 4.0.0 > $TRAVIS_BUILD_DIR/upgrade390400-3.log
|
||||
php upgrade.php 4.0.0 5.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade400500.log
|
||||
php upgrade2.php 4.0.0 5.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL > $TRAVIS_BUILD_DIR/upgrade400500-2.log
|
||||
php upgrade2.php 4.0.0 5.0.0 > $TRAVIS_BUILD_DIR/upgrade400500-2.log
|
||||
php step5.php 4.0.0 5.0.0 > $TRAVIS_BUILD_DIR/upgrade400500-3.log
|
||||
php upgrade.php 5.0.0 6.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade500600.log
|
||||
php upgrade2.php 5.0.0 6.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL > $TRAVIS_BUILD_DIR/upgrade500600-2.log
|
||||
php upgrade2.php 5.0.0 6.0.0 > $TRAVIS_BUILD_DIR/upgrade500600-2.log
|
||||
php step5.php 5.0.0 6.0.0 > $TRAVIS_BUILD_DIR/upgrade500600-3.log
|
||||
php upgrade.php 6.0.0 7.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade600700.log
|
||||
php upgrade2.php 6.0.0 7.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL > $TRAVIS_BUILD_DIR/upgrade600700-2.log
|
||||
php upgrade2.php 6.0.0 7.0.0 MAIN_MODULE_WEBSITE > $TRAVIS_BUILD_DIR/upgrade600700-2.log
|
||||
php step5.php 6.0.0 7.0.0 > $TRAVIS_BUILD_DIR/upgrade600700-3.log
|
||||
cd -
|
||||
set +e
|
||||
|
|
|
|||
|
|
@ -1843,7 +1843,7 @@ class DolibarrModules // Can not be abstract, because we need to insta
|
|||
$menu->langs=$this->menu[$key]['langs'];
|
||||
$menu->position=$this->menu[$key]['position'];
|
||||
$menu->perms=$this->menu[$key]['perms'];
|
||||
$menu->target=$this->menu[$key]['target'];
|
||||
$menu->target=isset($this->menu[$key]['target'])?$this->menu[$key]['target']:'';
|
||||
$menu->user=$this->menu[$key]['user'];
|
||||
$menu->enabled=isset($this->menu[$key]['enabled'])?$this->menu[$key]['enabled']:0;
|
||||
$menu->position=$this->menu[$key]['position'];
|
||||
|
|
|
|||
|
|
@ -61,11 +61,11 @@ error_reporting(0);
|
|||
@set_time_limit(300);
|
||||
error_reporting($err);
|
||||
|
||||
$setuplang=GETPOST("selectlang",'',3)?GETPOST("selectlang",'',3):'auto';
|
||||
$setuplang=GETPOST("selectlang",'alpha',3)?GETPOST("selectlang",'alpha',3):'auto';
|
||||
$langs->setDefaultLang($setuplang);
|
||||
$versionfrom=GETPOST("versionfrom",'',3)?GETPOST("versionfrom",'',3):(empty($argv[1])?'':$argv[1]);
|
||||
$versionto=GETPOST("versionto",'',3)?GETPOST("versionto",'',3):(empty($argv[2])?'':$argv[2]);
|
||||
$enablemodules=GETPOST("enablemodules",'',3)?GETPOST("enablemodules",'',3):(empty($argv[3])?'':$argv[3]);
|
||||
$versionfrom=GETPOST("versionfrom",'alpha',3)?GETPOST("versionfrom",'alpha',3):(empty($argv[1])?'':$argv[1]);
|
||||
$versionto=GETPOST("versionto",'alpha',3)?GETPOST("versionto",'alpha',3):(empty($argv[2])?'':$argv[2]);
|
||||
$enablemodules=GETPOST("enablemodules",'alpha',3)?GETPOST("enablemodules",'alpha',3):(empty($argv[3])?'':$argv[3]);
|
||||
|
||||
$langs->load('admin');
|
||||
$langs->load('install');
|
||||
|
|
@ -416,6 +416,7 @@ if (! GETPOST('action','aZ09') || preg_match('/upgrade/i',GETPOST('action','aZ09
|
|||
{
|
||||
// Reload modules (this must be always done and only into last targeted version)
|
||||
$listofmodules=array();
|
||||
$enablemodules=preg_replace('/enablemodules=/','',$enablemodules);
|
||||
$tmplistofmodules=explode(',', $enablemodules);
|
||||
foreach($tmplistofmodules as $value)
|
||||
{
|
||||
|
|
@ -4279,6 +4280,16 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array(),$force=0)
|
|||
$mod->init($reloadmode);
|
||||
}
|
||||
}
|
||||
if ($moduletoreload == 'MAIN_MODULE_SUPPLIERPROPOSAL') // Module after 3.5
|
||||
{
|
||||
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Supplier Proposal module");
|
||||
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modSupplierProposal.class.php';
|
||||
if ($res) {
|
||||
$mod=new modSupplierProposal($db);
|
||||
$mod->remove('noboxes'); // We need to remove because id of module has changed
|
||||
$mod->init($reloadmode);
|
||||
}
|
||||
}
|
||||
if ($moduletoreload == 'MAIN_MODULE_OPENSURVEY') // Permission has changed into 3.0
|
||||
{
|
||||
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Opensurvey module");
|
||||
|
|
@ -4309,6 +4320,16 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array(),$force=0)
|
|||
$mod->init($reloadmode);
|
||||
}
|
||||
}
|
||||
if ($moduletoreload == 'MAIN_MODULE_WEBSITE') // Module added in 7.0
|
||||
{
|
||||
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Website module");
|
||||
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modWebsite.class.php';
|
||||
if ($res) {
|
||||
$mod=new modWebsite($db);
|
||||
//$mod->remove('noboxes');
|
||||
$mod->init($reloadmode);
|
||||
}
|
||||
}
|
||||
|
||||
if (! empty($mod) && is_object($mod))
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user