Prechádzať zdrojové kódy

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

Shawna Spoor 6 rokov pred
rodič
commit
2ea7e8eb8d

+ 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]);