浏览代码

one last fix to address the random null name exceptions that were getting thrown by the plant trait ontology

Shawna Spoor 6 年之前
父节点
当前提交
2ea7e8eb8d
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      tripal_chado/includes/TripalImporter/OBOImporter.inc

+ 8 - 0
tripal_chado/includes/TripalImporter/OBOImporter.inc

@@ -864,6 +864,14 @@ class OBOImporter extends TripalImporter {
     $t['is_relationship'] = $is_relationship;
     $t['is_relationship'] = $is_relationship;
     $t['db_name'] = $default_db;
     $t['db_name'] = $default_db;
 
 
+    // The name being empty regularly causes problems, so let's check it's there.
+    if (empty($t['name'])){
+      $results = $this->oboEbiLookup($t['id'], 'term');
+      if (isset($results['label'])) {
+        $t['name'] = $results['label'];
+      } 
+    }
+    
     $cvterm = tripal_insert_cvterm($t, array('update_existing' => TRUE));
     $cvterm = tripal_insert_cvterm($t, array('update_existing' => TRUE));
     if (!$cvterm) {
     if (!$cvterm) {
       throw new Exception("Cannot add the term " . $term['id'][0]);
       throw new Exception("Cannot add the term " . $term['id'][0]);