Przeglądaj źródła

Merge pull request #929 from tripal/928-tv3-web_services_spaces

Web Services field causing problems
Stephen Ficklin 5 lat temu
rodzic
commit
4447af5d1e

+ 9 - 0
tripal_ws/includes/TripalWebService/TripalContentService_v0_1.inc

@@ -161,18 +161,27 @@ class TripalContentService_v0_1 extends TripalWebService {
       $field_name = $instance['field_name'];
       $field = field_info_field($field_name);
       $field_type = $field['type'];
+
       // Skip fields of remote data.
       if ($field_type == 'remote__data') {
         continue;
       }
+
       $vocabulary = $instance['settings']['term_vocabulary'];
       $accession = $instance['settings']['term_accession'];
       $temp_term = tripal_get_term_details($vocabulary, $accession);
+
+      // See if the name matches perfectly.
+      if (strtolower($temp_term['name']) == strtolower($expfield)) {
+        return [$field, $instance, $temp_term];
+      }
+
       // See if the name provided matches the field name after a bit of
       // cleanup.
       if (strtolower(preg_replace('/[^\w]/', '_', $temp_term['name'])) == strtolower($expfield)) {
         return [$field, $instance, $temp_term];
       }
+
       // Alternatively if the CV term accession matches then we're good too.
       if ($vocabulary . ':' . $accession == $expfield) {
         return [$field, $instance, $temp_term];