Browse Source

Added missing chado_cvterm_mapping for Map and Publication entity types

Chun-Huai Cheng 7 years ago
parent
commit
3ac80ad0d6

+ 14 - 0
legacy/tripal_core/theme/templates/node--chado-generic.tpl.php

@@ -252,6 +252,13 @@ function tripal_chado_prepare_chado() {
         throw new Exception($error['!message']);
       }
     }
+    // Add cvterm mapping for the Map entity type
+    $identifier = array(
+      'cv_id' => array('name' => 'EDAM'),
+      'name' => 'Map'
+    );
+    $cvterm = tripal_get_cvterm($identifier);
+    tripal_chado_add_cvterm_mapping($cvterm->cvterm_id, 'featuremap', NULL);
 
     // Import a publication so we get all of the properties before
     // creating the content type.
@@ -274,6 +281,13 @@ function tripal_chado_prepare_chado() {
         throw new Exception($error['!message']);
       }
     }
+    // Add cvterm mapping for the Publication entity type
+    $identifier = array(
+      'cv_id' => array('name' => 'tripal_pub'),
+      'name' => 'Publication'
+    );
+    $cvterm = tripal_get_cvterm($identifier);
+    tripal_chado_add_cvterm_mapping($cvterm->cvterm_id, 'pub', NULL);
 
     // Now remove the publication that was added above.
     $values = array(

+ 36 - 0
tripal_chado/includes/tripal_chado.entity.inc

@@ -995,4 +995,40 @@ function tripal_chado_update_7305() {
     $error = $e->getMessage();
     throw new DrupalUpdateException('Could not perform update: '. $error);
   }
+}
+
+/**
+ * Add cvterm mapping for the Map entity type
+ */
+function tripal_chado_update_7306() {
+  try {
+    $identifier = array(
+      'cv_id' => array('name' => 'EDAM'),
+      'name' => 'Map'
+    );
+    $cvterm = tripal_get_cvterm($identifier);
+    tripal_chado_add_cvterm_mapping($cvterm->cvterm_id, 'featuremap', NULL);
+  }
+  catch (\PDOException $e) {
+    $error = $e->getMessage();
+    throw new DrupalUpdateException('Could not perform update: '. $error);
+  }
+}
+
+/**
+ * Add cvterm mapping for the Publication entity type
+ */
+function tripal_chado_update_7307() {
+  try {
+    $identifier = array(
+      'cv_id' => array('name' => 'tripal_pub'),
+      'name' => 'Publication'
+    );
+    $cvterm = tripal_get_cvterm($identifier);
+    tripal_chado_add_cvterm_mapping($cvterm->cvterm_id, 'pub', NULL);
+  }
+  catch (\PDOException $e) {
+    $error = $e->getMessage();
+    throw new DrupalUpdateException('Could not perform update: '. $error);
+  }
 }