Browse Source

Fixed issue #39

Stephen Ficklin 7 years ago
parent
commit
9fcc06e5e4

+ 11 - 2
tripal/includes/TripalEntityUIController.inc

@@ -308,6 +308,14 @@ function tripal_view_entity($entity, $view_mode = 'full') {
    if ($etype) {
      $query->entityCondition('bundle', $etype);
    }
+   if ($status) {
+     if ($status == 'status-1') {
+       $query->propertyCondition('status', 1);
+     }
+     if ($status == 'status-0') {
+       $query->propertyCondition('status', 0);
+     }
+   }
    //$query->propertyOrderBy('created', 'DESC');
 
    // Find out the total number of records and determine what page we're on, and
@@ -324,8 +332,9 @@ function tripal_view_entity($entity, $view_mode = 'full') {
 
 
    // For each entity retrieved add a row to the data listing.
-   //while ($entity = $entities->fetchObject()) {
-   if (!isset($results['TripalEntity'])) $results['TripalEntity'] = array();
+   if (!isset($results['TripalEntity'])) {
+     $results['TripalEntity'] = array();
+   }
    foreach ($results['TripalEntity'] as $entity_id => $stub) {
      $vocabulary = '';
      $term_name = '';

+ 0 - 2
tripal_ws/includes/TripalWebServiceResource.inc

@@ -144,7 +144,6 @@ class TripalWebServiceResource {
 
       // If the vocabulary is not in the.
       if (!in_array($vocab, $keys)) {
-        dpm(debug_backtrace());
         throw new Exception("The key, '$key', has a vocabulary that has not yet been added to the " .
             "context. Use the addContextItem() function to add the vocabulary prior to adding a value for it.");
       }
@@ -152,7 +151,6 @@ class TripalWebServiceResource {
     else {
       // If the key is not in the context then throw an error.
       if (!in_array($key, $keys)) {
-        dpm(debug_backtrace());
         throw new Exception("The key, '$key', has not yet been added to the " .
             "context. Use the addContextItem() function to add this key prior to adding a value for it.");
       }