Browse Source

exit earlier in ws to accomodate field permissions

bradfordcondon 6 years ago
parent
commit
81afa2002a
1 changed files with 5 additions and 2 deletions
  1. 5 2
      tripal_ws/includes/TripalWebService/TripalContentService_v0_1.inc

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

@@ -370,12 +370,15 @@ class TripalContentService_v0_1 extends TripalWebService {
         // TODO: handle this case.
       }
     }
-
+    // Field specific permissions can result in an empty $values.
+    if (empty($values)) {
+      return;
+    }
     if ($hide_fields == TRUE and empty($values[0])) {
       return;
     }
 
-    // If the field cardinality is 1
+    // If the field cardinality is 1.
     if ($field['cardinality'] == 1) {
 
       // If the value is an array and this is the field page then all of those