$this->requireCiviModules($this->civiModules);
}
- $this->allModules = array_merge((array)$this->drupalModules, (array)$this->civiModules);
+ // we should add civicrm's module's just after main civicrm drupal module
+ foreach($this->drupalModules as $moduleName) {
+ $this->allModules[$moduleName] = $moduleName;
+ if ( $moduleName == 'civicrm' ) {
+ if (!empty($this->civiModules)) {
+ foreach( $this->civiModules as $civiModuleName) {
+ $this->allModules[$civiModules] = $civiModuleName;
+ }
+ }
+ }
+ }
+
if ($this->drupalModules !== NULL && $this->civiModules !== NULL) {
// both CRM and CMS have bootstrapped, so this is the final list
$this->isBuilt = TRUE;