OJS 3.3.0.7, OAI doesn't update the datestamp to the date of the last update to allow metadata harvest

Hi all, we identified the following problem, but I do not know if it’s a bug or something is missing to configure correctly.

In an OJS 3.3.0-7 from where a Vufind server harvest the metadata of published articles, Vufind doesn’t identify the updated articles in OAI-PMH because the datestamp isn’t updated to the date the article was updated.

I will try to describe an example, in an article published in OJS with submission ID 2437, in OAI the datestamp of the record header is:
1

In the database, in the publication_settings table, it belongs to the 618 journal.
2

The datestamp belongs to the date in the last_modified field of the issues table with the UTC time adjustment.
3

This is the publications table:
4

And this is the submissions table:
5

From OJS, after updating the article title and republishing, the dates were updated like this, in the submissions table updated the field date_last_activity but not the last_modified field:
6

In the publications table updated the field last_modified:
7

In the issues table didn’t update any field:
8

In OAI the datestamp of the article wasn’t updated, so it doesn’t re-harvest it:
9

To solve it, it was modified in the file classes/oai/ojs/OAIDAO.inc.php, adding p.last_modified in the following query:

  • 'SELECT GREATEST(a.last_modified, i.last_modified, p.last_modified) AS last_modified,
  • ’ . ($from?’ AND GREATEST(a.last_modified, i.last_modified, p.last_modified) >= ’ . $this->datetimeToDB($from):’’) . ’
  • ’ . ($until?’ AND GREATEST(a.last_modified, i.last_modified, p.last_modified) <= ’ . $this->datetimeToDB($until):’’) . ’

With this change, the OAI already shows the datestamp with the date of the last_modified field of the publications table and vufind already identifies it as an updated article to re-harvest it.
10

I await your comments to know if this modification is correct or any suggestions.
Regards.

David

I though this issue was fixed in 3.3.0-5 or so:

Try with this workaround:

If you confirm it fixes the problem, PKP will be able to address it in next release.

Cheers,
m.

Hi @dortega,

Could you open a pull request with the proposed changes? I’d be happy to give them a look.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Thanks for answering, of course I can, but where do I open the change proposal? It would be in this same forum https://forum.pkp.sfu.ca/ and I open a new topic by selecting “Software support” and “Function request”? or how?

Regards,
David

Hi @dortega,

Sorry, I could’ve been a lot more specific :slight_smile: What I meant is to open a pull request in Github containing the changes you’re proposing; see e.g.: Creating a pull request - GitHub Docs

This is how code contributions usually get reviewed and merged into the software.

If you get stuck in this process, let me know!

Regards,
Alec Smecher
Public Knowledge Project Team