Browse Source

Merge pull request #745 from mboudet/7.x-3.x

Fix undefined index in search tool
Bradford Condon 6 năm trước cách đây
mục cha
commit
ec3c53775b
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 4 1
      tripal/includes/TripalFieldQuery.inc

+ 4 - 1
tripal/includes/TripalFieldQuery.inc

@@ -124,7 +124,10 @@ class TripalFieldQuery extends EntityFieldQuery {
       if (is_numeric($results)) {
         return $results;
       }
-      return count($results['TripalEntity']);
+      if (array_key_exists('TripalEntity', $results)) {
+        return count($results['TripalEntity']);
+      }
+      return 0;
     }
     return $results;
   }