Index: includes/entity.inc
===================================================================
@@ -169,13 +169,31 @@
     else {
       $revision_id = FALSE;
     }
-
+ 
     // Create a new variable which is either a prepared version of the $ids
     // array for later comparison with the entity cache, or FALSE if no $ids
     // were passed. The $ids array is reduced as items are loaded from cache,
     // and we need to know if it's empty for this reason to avoid querying the
     // database when all requested entities are loaded from cache.
-    $passed_ids = !empty($ids) ? array_flip($ids) : FALSE;
+
+    //////////////////////////////// Patched By Stephen ////////////////////////////////
+    //$passed_ids = !empty($ids) ? array_flip($ids) : FALSE; // removed
+    $passed_ids=TRUE;
+    if(empty($ids)){
+      $passed_ids=FALSE;
+    }
+    else{
+      foreach($ids as $key=>$value){
+        if(is_array($value)){
+          $passed_ids=FALSE; 
+        }
+      }
+    }
+    if($passed_ids==TRUE){
+      $passed_ids=array_flip($ids);
+    }
+    //////////////////////////////// Patched By Stephen ////////////////////////////////
+
     // Try to load entities from the static cache, if the entity type supports
     // static caching.
     if ($this->cache && !$revision_id) {
