소스 검색

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

Fix undefined index in search tool
Bradford Condon 6 년 전
부모
커밋
ec3c53775b
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  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;
   }