diff --git a/plugins/importexport/onix30/filter/MonographONIX30XmlFilter.inc.php b/plugins/importexport/onix30/filter/MonographONIX30XmlFilter.inc.php index f204af48297..b29dd57d15f 100644 --- a/plugins/importexport/onix30/filter/MonographONIX30XmlFilter.inc.php +++ b/plugins/importexport/onix30/filter/MonographONIX30XmlFilter.inc.php @@ -402,7 +402,6 @@ function createProductNode($doc, $submission, $publicationFormat) { unset($extentNode); } - /* --- Add Subject elements --- */ $subjectNode = $doc->createElementNS($deployment->getNamespace(), 'Subject'); @@ -411,19 +410,20 @@ function createProductNode($doc, $submission, $publicationFormat) { $subjectNode->appendChild($this->_buildTextNode($doc, 'SubjectSchemeIdentifier', '12')); // 12 is BIC subject category code list. $subjectNode->appendChild($this->_buildTextNode($doc, 'SubjectSchemeVersion', '2')); // Version 2 of ^^ - $submissionSubjectDao = DAORegistry::getDAO('SubmissionSubjectDAO'); - $allSubjects = $submissionSubjectDao->getSubjects($publication->getId(), array_keys(AppLocale::getSupportedFormLocales())); - $uniqueSubjects = array(); - foreach ($allSubjects as $locale => $subjects) { - $uniqueSubjects = array_merge($uniqueSubjects, $subjects); + if ($publication->getData('subjects')) { + $allSubjects = ($publication->getData('subjects')[$publication->getData('locale')]); + $subjectNode->appendChild($this->_buildTextNode($doc, 'SubjectCode', trim(join(', ', $allSubjects)))); } + $descDetailNode->appendChild($subjectNode); - if (sizeof($uniqueSubjects) > 0) { - $subjectNode->appendChild($this->_buildTextNode($doc, 'SubjectCode', trim(join(', ', $uniqueSubjects)))); + if ($publication->getData('keywords')) { + $allKeywords = ($publication->getData('keywords')[$publication->getData('locale')]); + $keywordNode = $doc->createElementNS($deployment->getNamespace(), 'Subject'); + $keywordNode->appendChild($this->_buildTextNode($doc, 'SubjectSchemeIdentifier', '20')); // Keywords + $keywordNode->appendChild($this->_buildTextNode($doc, 'SubjectHeadingText', trim(join(', ', $allKeywords)))); + $descDetailNode->appendChild($keywordNode); } - $descDetailNode->appendChild($subjectNode); - /* --- Add Audience elements --- */ if ($submission->getData('audience')) {