Skip to content

Commit

Permalink
Merge pull request #1239 from dsenalik/1238-tv3-pubmed_importer
Browse files Browse the repository at this point in the history
For issue #1238 tv3 pubmed importer fix
  • Loading branch information
spficklin committed Nov 22, 2021
2 parents 2580fc6 + 3b0bb83 commit f0dd0d3
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,9 @@ function tripal_pub_PMID_parse_date($xml, $element_name) {
case 'MedlineDate':
// the medline date is when the date cannot be broken into distinct month day year.
$xml->read();
$date['year'] = preg_replace('/^(\d{4}).*$/', '\1', $xml->value);
if (!$date['year']) {
$date['year'] = preg_replace('/^.*(\d{4}).*$/', '\1', $xml->value);
}
$date['medline'] = $xml->value;
break;
default:
Expand Down

0 comments on commit f0dd0d3

Please sign in to comment.