Skip to content

Commit

Permalink
Merge pull request #1559 from tripal/tv4g4-issue1557-obo-importer-php8
Browse files Browse the repository at this point in the history
Tripal 4 php8 warning fix in OBO loader
  • Loading branch information
laceysanderson committed Jul 6, 2023
2 parents 4cb1dbc + e01b302 commit 1a23b43
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions tripal_chado/src/Plugin/TripalImporter/OBOImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2370,8 +2370,13 @@ private function parse($obo_file, &$header) {
$stanza['namespace'][0] = 'EDAM';
}
$namespace = $stanza['namespace'][0];
$cv = $this->all_cvs[$namespace];
$this->obo_namespaces[$namespace] = $cv->cv_id;
if (array_key_exists($namespace, $this->all_cvs)) {
$cv = $this->all_cvs[$namespace];
$this->obo_namespaces[$namespace] = $cv->cv_id;
}
else {
$this->obo_namespaces[$namespace] = NULL;
}
}

// Before caching this stanza, check the term's name to
Expand Down Expand Up @@ -2430,8 +2435,13 @@ private function parse($obo_file, &$header) {
// If this term has a namespace then we want to keep track of it.
if (array_key_exists('namespace', $stanza)) {
$namespace = $stanza['namespace'][0];
$cv = $this->all_cvs[$namespace];
$this->obo_namespaces[$namespace] = $cv->cv_id;
if (array_key_exists($namespace, $this->all_cvs)) {
$cv = $this->all_cvs[$namespace];
$this->obo_namespaces[$namespace] = $cv->cv_id;
}
else {
$this->obo_namespaces[$namespace] = NULL;
}
}
$this->cacheTermStanza($stanza, $type);
$this->setItemsHandled($num_read);
Expand Down

0 comments on commit 1a23b43

Please sign in to comment.