Problem with <first_page> and <last_pages>

Dear colleagues,
I have a problem with the display of the first page and the last page in the search Crossref. We are seen some OJS the first page and the last page.

For example

My journal

We don’t have “… to …”. How i can change it?
Kind regards,

Try to change:
XMLCustomWriter::createChildWithText($doc, $pageNode, ‘other_pages’, $otherPages);
XMLCustomWriter::createChildWithText($doc, $pageNode, ‘last_page’, $otherPages);
in: plugins/importexport/crossref/classes/

And then export DOI metadata again.
The ‘other_pages’ is apparently not understood by Crossref.

1 Like

This is the first I tried it and I got the error: [Error]: 2: 3824: cvc-complex-type.2.4.a: Invalid content was found starting with element ‘last_pages’. One of ‘{ “":last_page,"”:other_pages}’ is expected.

You put “last_pages”, I wrote “last_page”.

Oh my God!!!
Thank you, its working! My inattention…

It does not get what we need …
An error has disappeared, but the range of pages did not appear after update…

See also this old forum post:
And this languishing issue report:

There is a larger problem with our compliance with CrossRef’s expectation for page numbering. It is made complex by the large number of plugins which all use the pages field.

this issue seems to have been fixed since v2.4.8-3:

  * @file plugins/importexport/crossref/classes/ 

 		/* publisher_item is the article pages */
-		if ($article->getPages() != '') {
-			$pageNode =& XMLCustomWriter::createElement($doc, 'pages');
-			// extract the first page for the first_page element, store the remaining bits in otherPages,
-			// after removing any preceding non-numerical characters.
-			if (preg_match('/^[^\d]*(\d+)\D*(.*)$/', $article->getPages(), $matches)) {
-				$firstPage = $matches[1];
-				$otherPages = $matches[2];
+		// CrossRef requires first_page and last_page of any contiguous range, then any other ranges go in other_pages
+		$pages = $article->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 = '';
+			}