From d41b2662ba71a02be26c9fcedf3160f87af6ec3d Sat, 17 Dec 2011 21:07:27 +0100
From: Bram Goffings <bramgoffings@gmail.com>
Date: Sat, 17 Dec 2011 21:07:12 +0100
Subject: [PATCH] Switched hook order



diff --git a/core/modules/entity/entity.controller.inc b/core/modules/entity/entity.controller.inc
index 04c1f31..19a4a4d 100644
--- a/core/modules/entity/entity.controller.inc
+++ b/core/modules/entity/entity.controller.inc
@@ -335,11 +335,6 @@
       }
     }
 
-    // Call hook_entity_load().
-    foreach (module_implements('entity_load') as $module) {
-      $function = $module . '_entity_load';
-      $function($queried_entities, $this->entityType);
-    }
     // Call hook_TYPE_load(). The first argument for hook_TYPE_load() are
     // always the queried entities, followed by additional arguments set in
     // $this->hookLoadArguments.
@@ -347,6 +342,11 @@
     foreach (module_implements($this->entityInfo['load hook']) as $module) {
       call_user_func_array($module . '_' . $this->entityInfo['load hook'], $args);
     }
+    // Call hook_entity_load().
+    foreach (module_implements('entity_load') as $module) {
+      $function = $module . '_entity_load';
+      $function($queried_entities, $this->entityType);
+    }
   }
 
   /**
