Issue with keywords in upgrading from OJS 2.4.8-1 to OJS 3.2.x

Hi,

When I upgrade from 2.4.8-1 to OJS 3.2.0-2, the keywords that the article loads correspond to another article. This happens in all articles of the journal

However, if I upgrade before from 2.4.8-1 to 3.1.2-4 and after 3.1.2-4 to 3.2.0-2 the keywords load correctly in all articles.

This also happens with the the languages of the article and with the supporting agencies

I have compared the tables: “controlled_vocab_entries”, “controlled_vocab_entry_settings” and “controlled_vocabs” in both processes (2841–>3124–>3202 and 2841–>3202) and they are completely different.

No errors during the upgrade and in the php_log

Regards

Hi @juanf.csic,

Would you be willing to share your OJS 2.4.8-1 database dump and files directory with me so I can do some local testing? If so, please send me a PM.

Thanks,
Alec Smecher
Public Knowledge Project Team

Hi Alec,

I send you a private message with the OJS 2.4.8-1 database dump and a copy of the files directory and public directory

Thank you very much.
Regards

Hi Alec,

I tried two other journals, in case the problem was the journal I tested first, but the problem is repeated…

So, I think I’m going to upgrade our 37 journals, upgrading first to 3.1.2-4, and after 3.1.2-4 to 3.2.0-2.

Thank you very much.
Regards

Hi @juanf.csic,

Thanks for the information – and with apologies for the delay, I was able to replicate the problem. It affects upgrades from OJS 2.x to 3.2.0-0, 3.2.0-1, and 3.2.0-2. I’ve filed it here: OJS 2.x to 3.2.0 (prior to 3.2.0-3) migration scrambles keyword, discipline, supporting agency, subject article metadata · Issue #5787 · pkp/pkp-lib · GitHub

This will be fixed in the next release, but I’ll also post a patch for an SQL query that should resolve the issue for those who have already run the upgrade.

I confirm that your strategy of upgrading from 2.x to 3.1.2-4 to 3.2.0-2 will also work.

Thanks,
Alec Smecher
Public Knowledge Project Team

1 Like

Hi Alec, thank you very much!!

I have tested the patches you propose, and they work for keywords and agencies, but the languages field has not worked … I have checked that the patches do not apply to this field.

Should the SubmissionLanguageDAO.inc.php file be patched too?

Regards

Hi Alec,

I have detected that the Supporting Agencies appear well assigned in the database, but in submissions they do not appear in the matadata.

metadata1

In line 29 of the file SubmissionAgencyDAO.inc.php shouldn’t it be something like this ?

return parent::_build(CONTROLLED_VOCAB_SUBMISSION_AGENCY, $assocType, $publicationId);

If I make this change, if they load correctly.

metadata2

Thank you very much.
Regards

Hi @juanf.csic,

In line 29 of the file SubmissionAgencyDAO.inc.php shouldn’t it be something like this ?
return parent::_build(CONTROLLED_VOCAB_SUBMISSION_AGENCY, $assocType, $publicationId);
If I make this change, if they load correctl

Oops, you’re correct – I’ve added that change to the list for issue #5787.

Thanks,
Alec Smecher
Public Knowledge Project Team

That’s great.
Thank you, Alec.

I also told you in the previous post, that with the patches the bug in the languages field had not been fixed…

Please could you check?

Thank you very much.
Regards

Hi @juanf.csic,

These two commits should take care of that:

Regards,
Alec Smecher
Public Knowledge Project Team

Hi Alec.

I’ve tested the patches you propose for the languages field. Now after the upgrade it is already imported, but in some submissions the field is empty or changed.

For example in the submissions 6, 7, 8 and 9, the languages field is empty, however in my database 2.8.8-1 those articles have information in that field. And in the submission 16 it appears “en” and in my database 2.8.8-1 there is “es”

captura2
captura3
captura1

I have not deleted on my server the OJS 2.4.8-1 database dump I sent by PM. In case you need it…

Thank you very much.
Regards

Hi @juanf.csic,

Just to make sure I’m following correctly – did you re-run the upgrade after applying the patches?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi Alec,

I checked that I had made the changes. And I’ve made the upgrade again, and it’s still wrong.

But I have checked the changes you had made in the code to fix the bugs in agencies, disciplines, keywords, etc… and I have seen that in the files: SubmissionAgencyDAO.inc.php, SubmissionDisciplineDAO.inc.php, etc… and you had modified the “function insertAgencies”, “function insertAgencies”, “function insertDisciplines”, etc.

But the SubmissionLanguageDAO.inc.php file, you had not modified the “function insertLanguages”. So I tried to make the same changes in this file:

Line 95: function insertLanguages($languages, $publicationId, $deleteFirst = true, $assocType = ASSOC_TYPE_PUBLICATION) {

Line 98: $currentLanguages = $this->build($publicationId, $assocType);

Line 116: $languageEntry->setControlledVocabId($currentLanguages->getId());

I tried again to do the upgrade, and it seems to work, but I don’t know if it was a coincidence … or if it would be necessary to change more code …

Thank you very much.
Regards

Hi @juanf.csic,

You are absolutely right – I made the change to the wrong function! I’ve corrected this; see pkp/pkp-lib#5787 Fix migration of language metadata (previous fix add… · pkp/pkp-lib@13ba606 · GitHub.

Thanks,
Alec Smecher
Public Knowledge Project Team