PKP Bugzilla – Bug 6245
2.2.x -> 2.3.3-3 upgrade "removes" submission notes
Last modified: 2011-02-23 14:41:52 PST
Reported by John: http://pkp.sfu.ca/support/forum/viewtopic.php?f=8&t=6863&p=26576#p26576, and I've replicated. After upgrading, any previously created notes aren't listed in the submission notes page, but they can be accessed by going directly to the submission note's Edit page (eg. http://git/ojs224/index.php/demo/editor/submissionNotes/1/edit/1).
On a possibly related topic -- has the note storage location changed by any chance? If I edit the note, my changes seem to be saved according to the UI; but the note in the article_notes table doesn't appear to be updated.
James, the storage for article notes has moved from "article_notes" to the generalized "notes" table. Could you pass me a database dump for that table so I can see what happened during upgrade?
Actually, scratch that -- after upgrade, the article_notes table is completely empty, and the note appears as it should in the notes table as it should. If I go directly to the Edit interface and edit the note, my edit is reflected in the notes table, and the note actually then appears in the Submission Notes listing.
James, does this mean that after the upgrade the notes are somehow in a bad state, but that editing them and saving them corrects that state? Or do I misunderstand?
Created attachment 3371 [details]
article_notes table, pre-upgrade
Created attachment 3372 [details]
notes table, before editing a note
Created attachment 3373 [details]
notes table, after editing a note
(In reply to comment #3)
> James, does this mean that after the upgrade the notes are somehow in a bad
> state, but that editing them and saving them corrects that state? Or do I
It looks like the context_id field isn't being set properly on upgrade. All note context_ids are set to null after the upgrade is complete, but switch to 1 when I edit and save a note. Notes only display when the context_id is set to 1. The attached table xml dumps should be fairly self-explanatory; you'll see that in notes_post-edit.xml only one context_id field is 1 -- that's because I only edited the one note.
Created attachment 3374 [details]
Patch against OJS 2.3.3-3
James, could you try the attached patch? You may need to patch bug #6220 first, before this patch will apply cleanly. It'll need to be applied before you run the upgrade process.
Created attachment 3375 [details]
Patch against OJS 2.3.3-3
Oops, corrected patch.
Also fixed for OCS (doesn't affect any released versions). See https://github.com/pkp/ocs/commit/b48b31e3cd92c7dc8faa349d9cb0802c1e0be721
(In reply to comment #9)
> James, could you try the attached patch? You may need to patch bug #6220 first,
> before this patch will apply cleanly. It'll need to be applied before you run
> the upgrade process.
Hi Alec, that appears to do the trick. I'm guessing that if the upgrade process has already been completed, users running into this issue can just set the context_id fields in the notes table to 1?
(In reply to comment #12)
> (In reply to comment #9)
> > James, could you try the attached patch? You may need to patch bug #6220 first,
> > before this patch will apply cleanly. It'll need to be applied before you run
> > the upgrade process.
> Hi Alec, that appears to do the trick. I'm guessing that if the upgrade process
> has already been completed, users running into this issue can just set the
> context_id fields in the notes table to 1?
Oops -- just looked at the patch -- that would be, they set the context_id to the relevant journal ID.
That should be possible using:
UPDATE notes n, articles a SET n.context_id = a.journal_id WHERE a.article_id = n.assoc_id;
In upgrade from 2.2.3:
ERROR: Upgrade failed: DB: Unknown column 'notes.context_id' in 'field list'
The notes.xml schema doesn't seem to have a context_id, which I assume should? Also, there still appears to be an article_notes definition in ojs_schema.xml. And to be a real nitpick, the table comment in notes.xml refers to the groups table.
The context column isn't necessary and was removed from other parts of the system. I've removed it from the upgrade process too:
Also removed unnecessary article_notes table definition and corrected notes table comment (in separate commits).