Преглед изворни кода

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['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));
     if (!$cvterm) {
       throw new Exception("Cannot add the term " . $term['id'][0]);