Deleting discussion causes inconsistency in database, OJS 3.1.1-4

Hi,

in OJS 3.1.1-4, review discussions:

I upload a new file, save the discussion and delete it again. If I then open “Editorial History”, the data cannot be loaded.

Error message:

PHP Fatal error: Call to a member function getStageId() on null in …lib/pkp/classes/submission/PKPSubmissionFileDAO.inc.php on line 762, referer:…/index.php/journal2/workflow/index/88/3

The item in table “notes” is deleted, but the file is still listed in “submission_files” with assoc type 520 and assoc id pointing to the deleted note.

best,
Carola

P.S. Is it save to delete the line in table submission_files?

Hi @carola

You probably want to apply a small patch to your OJS installation. This is a small bug that was fixed in OJS 3.1.2, and the modification is here:

https://github.com/pkp/pkp-lib/blob/stable-3_1_2/classes/submission/SubmissionFileDAO.inc.php#L774

(Note that you’d want to make this change in PKPSubmissionFileDAO, which is what you’d have)

Cheers,
Jaso

1 Like

Hi @jnugent,

thanks, the fix worked!

Will there also be a fix that deletes files when the containing notes are deleted or will these files be kept in OJS?

best,
Carola

Hi @carola

I had a look through the 3.1.2 code and no, query deletion does not remove files that may have been associated with a review discussion. Review discussion can include files from other areas of the workflow so there’s probably good reason for that.

Cheers,
Jason