diff --git a/plugins/importexport/native/NativeImportDom.inc.php b/plugins/importexport/native/NativeImportDom.inc.php index d1a7cd8..f87b64b 100644 --- a/plugins/importexport/native/NativeImportDom.inc.php +++ b/plugins/importexport/native/NativeImportDom.inc.php @@ -286,8 +286,7 @@ class NativeImportDom { --- Otherwise, the whole process was successful. */ if ($hasErrors) { - $issueDao->deleteIssue($issue); - $issue = null; + $issue = null; // Don't pass back a reference to a dead issue if ($cleanupErrors) { NativeImportDom::cleanupFailure ($dependentItems); } @@ -787,6 +786,14 @@ class NativeImportDom { } } + for ($index=0; ($node = $articleNode->getChildByName('id', $index)); $index++) { + switch ($node->getAttribute('type')) { + case 'doi': + $article->setStoredDOI($node->getValue()); + break; + } + } + $articleDao->insertArticle($article); $dependentItems[] = array('article', $article); @@ -835,14 +842,6 @@ class NativeImportDom { $publishedArticle->setId($article->getId()); $publishedArticle->setIssueId($issue->getId()); - for ($index=0; ($node = $articleNode->getChildByName('id', $index)); $index++) { - switch ($node->getAttribute('type')) { - case 'doi': - $publishedArticle->setStoredDOI($node->getValue()); - break; - } - } - if (($node = $articleNode->getChildByName('date_published'))) { $publishedDate = strtotime($node->getValue()); if ($publishedDate === -1) {