X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=CRM%2FUtils%2FHook%2FDrupalBase.php;h=68a01f555c6808e0a7c1189ffb4273f00f3c1e2e;hb=e7f7aef7265627c99d27b5e9cecdfe5d3e50f7de;hp=1561ff3dee839b70a962dc278ec1e751ee080294;hpb=0ec03e9fabc23b802ac80cb68c44b5abaf7f8585;p=civicrm-core.git diff --git a/CRM/Utils/Hook/DrupalBase.php b/CRM/Utils/Hook/DrupalBase.php index 1561ff3dee..68a01f555c 100644 --- a/CRM/Utils/Hook/DrupalBase.php +++ b/CRM/Utils/Hook/DrupalBase.php @@ -1,7 +1,7 @@ requireCiviModules($this->civiModules); } - $this->allModules = array_merge((array)$this->drupalModules, (array)$this->civiModules); + // CRM-12370 + // we should add civicrm's module's just after main civicrm drupal module + // Note: Assume that drupalModules and civiModules may each be array() or NULL + if ($this->drupalModules !== NULL) { + foreach ($this->drupalModules as $moduleName) { + $this->allModules[$moduleName] = $moduleName; + if ($moduleName == 'civicrm') { + if (!empty($this->civiModules)) { + foreach ($this->civiModules as $civiModuleName) { + $this->allModules[$civiModuleName] = $civiModuleName; + } + } + } + } + } + else { + $this->allModules = (array) $this->civiModules; + } + if ($this->drupalModules !== NULL && $this->civiModules !== NULL) { // both CRM and CMS have bootstrapped, so this is the final list $this->isBuilt = TRUE;