|
@@ -520,6 +520,9 @@ class TripalContentService_v0_1 extends TripalWebService {
|
|
// Index number (0, 1, 2...) of a hydra:member array.
|
|
// Index number (0, 1, 2...) of a hydra:member array.
|
|
$temp[$k] = $this->sanitizeFieldKeys($resource, $v, $bundle, $service_path);
|
|
$temp[$k] = $this->sanitizeFieldKeys($resource, $v, $bundle, $service_path);
|
|
}
|
|
}
|
|
|
|
+ elseif ($k == 'entity') {
|
|
|
|
+ $temp[$k] = $v;
|
|
|
|
+ }
|
|
else {
|
|
else {
|
|
// TODO: this is an error, if we get here then we have
|
|
// TODO: this is an error, if we get here then we have
|
|
// a key that isn't using the proper format... what to do?
|
|
// a key that isn't using the proper format... what to do?
|
|
@@ -879,13 +882,13 @@ class TripalContentService_v0_1 extends TripalWebService {
|
|
|
|
|
|
// Get the TripalBundle, TripalTerm and TripalVocab type for this type.
|
|
// Get the TripalBundle, TripalTerm and TripalVocab type for this type.
|
|
$bundle = tripal_load_bundle_entity(['label' => $ctype]);
|
|
$bundle = tripal_load_bundle_entity(['label' => $ctype]);
|
|
-
|
|
|
|
|
|
+
|
|
// Check that the user has access to this bundle. If not then the
|
|
// Check that the user has access to this bundle. If not then the
|
|
// function call will throw an error.
|
|
// function call will throw an error.
|
|
if (!user_access('view ' . $bundle->name)) {
|
|
if (!user_access('view ' . $bundle->name)) {
|
|
throw new Exception("Permission Denied.");
|
|
throw new Exception("Permission Denied.");
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
$term = entity_load('TripalTerm', ['id' => $bundle->term_id]);
|
|
$term = entity_load('TripalTerm', ['id' => $bundle->term_id]);
|
|
$term = reset($term);
|
|
$term = reset($term);
|
|
|
|
|
|
@@ -1058,7 +1061,7 @@ class TripalContentService_v0_1 extends TripalWebService {
|
|
// Show only content types users have access to and skip the rest.
|
|
// Show only content types users have access to and skip the rest.
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
$entity = entity_load('TripalTerm', ['id' => $bundle->term_id]);
|
|
$entity = entity_load('TripalTerm', ['id' => $bundle->term_id]);
|
|
$term = reset($entity);
|
|
$term = reset($entity);
|
|
$vocab = $term->vocab;
|
|
$vocab = $term->vocab;
|