Page number in Crossref XML missing due to using – instead of - between page numbers

Describe the issue or problem

I ran into a very specific problem. We have entered all page numbers with “–” instead of “-” which leads to the pages not being included in the XML Metadata for Crossref.

I am contemplating of either changing all “–” to “-” in the database but am asking myself if that is really necessary since the OAI export works just fine.

I am guessing this is handled in ArticleCrossrefXmlFilter.inc.php.

// pages
		// CrossRef requires first_page and last_page of any contiguous range, then any other ranges go in other_pages
		$pages = $publication->getPageArray();
		if (!empty($pages)) {
			$firstRange = array_shift($pages);
			$firstPage = array_shift($firstRange);
			if (count($firstRange)) {
				// There is a first page and last page for the first range
				$lastPage = array_shift($firstRange);
			} else {
				// There is not a range in the first segment
				$lastPage = '';
			}
			// CrossRef accepts no punctuation in first_page or last_page
			if ((!empty($firstPage) || $firstPage === "0") && !preg_match('/[^[:alnum:]]/', $firstPage) && !preg_match('/[^[:alnum:]]/', $lastPage)) {
				$pagesNode = $doc->createElementNS($deployment->getNamespace(), 'pages');
				$pagesNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(), 'first_page', $firstPage));
				if ($lastPage != '') {
					$pagesNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(), 'last_page', $lastPage));
				}
				$otherPages = '';
				foreach ($pages as $range) {
					$otherPages .= ($otherPages ? ',' : '').implode('-', $range);
				}
				if ($otherPages != '') {
					$pagesNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(), 'other_pages', $otherPages));
				}
				$journalArticleNode->appendChild($pagesNode);
			}
		}

What would your approach be?

Thanks!

Hi @D_Schroeder_Micheel,

Thanks for your post - would you mind indicating what version you’re working form (e.g. 3.3.0-8)?

-Roger
PKP team

Hi @rcgillis,

I am on OJS 3.3.0.20. I addressed it by replacing the dashes via this SQL order:

UPDATE publication_settings
SET setting_value = REPLACE(setting_value, '–', '-')
WHERE setting_name = 'pages';

I will reassign the DOIs now to check whether it worked.

Thank you!

2 Likes

This topic was automatically closed after 43 hours. New replies are no longer allowed.