Browse Source

Accidentally merged incorrect fix for issue #565. Here is a corrected fix

Stephen Ficklin 6 years ago
parent
commit
d468453644

+ 3 - 0
tripal/includes/TripalFieldQuery.inc

@@ -120,6 +120,9 @@ class TripalFieldQuery extends EntityFieldQuery {
       $results = $this->_intersectResults($results, $st_results);
     }
 
+    if ($this->count == TRUE) {
+      return count($results['TripalEntity']);
+    }
     return $results;
   }
   

+ 2 - 1
tripal_ws/includes/TripalWebService/TripalContentService_v0_1.inc

@@ -885,7 +885,8 @@ class TripalContentService_v0_1 extends TripalWebService {
 
     // Perform the query just as a count first to get the number of records.
     $cquery = clone $query;
-    $num_records = $cquery->count();
+    $cquery->count();
+    $num_records = $cquery->execute();
 
     if (!$num_records) {
       $num_records = 0;

+ 0 - 4
tripal_ws/includes/TripalWebServiceResource.inc

@@ -43,10 +43,6 @@ class TripalWebServiceResource {
 
     // First, add the RDFS and Hydra vocabularies to the context.  All Tripal
     // web services should use these.
-    $vocab = tripal_get_vocabulary_details('rdf');
-
-    $this->addContextItem('rdf', $vocab['sw_url']);
-
     $vocab = tripal_get_vocabulary_details('rdfs');
     $this->addContextItem('rdfs', $vocab['sw_url']);