Browse Source

Proposed Fix to Issue #1019 - Hydra:member empty

Added additional condition in sanitize function to handle case when key is a non-vocabulary term such as the key/index (0,1,2...) of a hydra:member array.
Reynold Tan 5 years ago
parent
commit
5abf2fb7fd
1 changed files with 5 additions and 1 deletions
  1. 5 1
      tripal_ws/includes/TripalWebService/TripalContentService_v0_1.inc

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

@@ -514,7 +514,11 @@ class TripalContentService_v0_1 extends TripalWebService {
             $temp[$key] = $v;
           }
           $term['name'] = $key;
-
+        }
+        elseif (is_numeric($k)) {
+          // Key is non-vocabulary term:
+          // Index number (0, 1, 2...) of a hydra:member array.
+          $temp[$k] = $this->sanitizeFieldKeys($resource, $v, $bundle, $service_path);
         }
         else {
           // TODO: this is an error, if we get here then we have