worked on CRM-12370, add civicrm modules after main civicrm drupal module
authorKurund Jalmi <kurund@civicrm.org>
Sun, 28 Apr 2013 07:30:16 +0000 (00:30 -0700)
committerKurund Jalmi <kurund@civicrm.org>
Sun, 28 Apr 2013 07:30:16 +0000 (00:30 -0700)
CRM/Utils/Hook/Drupal.php

index b998aeb71ec5ca15d98eb3ee0c0b500139f2dce7..e5e8b71259d126d834efe731c0bea3d869e6a5fd 100644 (file)
@@ -84,7 +84,18 @@ class CRM_Utils_Hook_Drupal extends CRM_Utils_Hook {
         $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;