Make sure that we initialize the list of modules with just the default config and not the previous config. Setup now supports removing modules (even if the actual data are NOT removed from the database, yet).

SVN:trunk[1189]
This commit is contained in:
Denis Flaven
2011-04-07 08:22:57 +00:00
parent 65ef621e6f
commit 4fefaa5658

View File

@@ -502,16 +502,12 @@ function AddHiddenParam($oP, $sName, $value)
function BuildConfig(SetupWebpage $oP, Config &$oConfig, $aParamValues, $aAvailableModules)
{
// Initialize the arrays below with default values for the application...
$aAddOns = $oConfig->GetAddOns();
$aAppModules = $oConfig->GetAppModules();
// New module in 1.1: synchro, when migrating an *old* configuration file to 1.1 the module may be missing
if (!in_array('synchro/synchrodatasource.class.inc.php', $aAppModules))
{
$aAppModules[] = 'synchro/synchrodatasource.class.inc.php';
}
$aDataModels = $oConfig->GetDataModels();
$aWebServiceCategories = $oConfig->GetWebServiceCategories();
$aDictionaries = $oConfig->GetDictionaries();
$oEmptyConfig = new Config('dummy_file', false); // Do NOT load any config file, just set the default values
$aAddOns = $oEmptyConfig->GetAddOns();
$aAppModules = $oEmptyConfig->GetAppModules();
$aDataModels = $oEmptyConfig->GetDataModels();
$aWebServiceCategories = $oEmptyConfig->GetWebServiceCategories();
$aDictionaries = $oEmptyConfig->GetDictionaries();
// Merge the values with the ones provided by the modules
// Make sure when don't load the same file twice...
foreach($aParamValues['module'] as $sModuleId)