Open jnugent opened 1 year ago
@jnugent, is this issue still present when you stop after step 3 above, i.e. when you keep the unsorted table of contents but do not add any more items?
@ewhanson Yes, it is. I just tested in a 3.3.0.16 install and if I add two articles to an issue and schedule for publication, they both go in with seq
of 0 in the publications
table. If I then publish this issue, I end up with a TOC that has two articles that flip back and forth on each reload (or nearly every reload).
The database records look like:
and the two TOCs look like:
or
@jnugent, thanks for the details. This came up with some of the Coalition Publica work as well so I'm going to dive into it. I haven't done any testing yet, but do you know if this is also a problem in 3.4 and later? (I'm assuming if it wasn't fixed in 3.3, it's still present, but want to know what I'm getting myself into).
Hi @ewhanson I just tested this in our 3.4 testdrive. If I schedule a submission for publication in an empty issue, it gets a seq
of 0. If add a second article to that same issue, it gets a seq
of 1. So this might not be a problem in 3.4. I think @jonasraoni may have worked on this.
Hi @jnugent and @jonasraoni. Is there any update on the status of this bug fix? Will it be released with 3.4 update? Any information is greatly appreciated. Thank you.
Sergiy
PS I see OJS 3.4 was released on June 9, 2023 and OJS 3.4.05 on February 23, 2024. But I cannot tell from release notes if this bug was addressed. Thanks.
@aupress I'm currently investigating the status of this. Will provide an update here once a fix has been made.
@jnugent, I'm testing it locally on stable-3_4_0
and still seeing all publications assigned to a seq
of 0. Do you know at which point in the publication process the second article was getting a seq
of 1?
@ewhanson you're right, it's not incrementing. I am not sure what I was looking at before.
publications
table is created when the submission is created. At that time the seq is 0.issueId
setting_name record in publication_settings
is created, but the seq
in the publications
table is not updated.Upon specifically ordering articles in the Issue table of contents, the seq
values get set correctly.
Thanks @jnugent, that's helpful (and glad I'm not going crazy). I'm working on a fix to set the seq
when it's assigned to an issue and will see how that behaves.
Describe the bug When a submission is first created, the publication record associated with it gets a
seq
value of 0, which makes sense since it isn't in an issue yet. When the submission is ultimately assigned to an issue and the issue is published, these 0seq
values are not re-sequenced into incrementing integers. This results in the articles within a section randomly ordering the articles and this order will change from page load to page load. The only way around this is to specify a sort order within the issue's table of contents. That's probably fine. However, when new articles are added to an issue with an already set sort order, the 0seq
values cause these articles to appear at the top of the section, and they will flip randomly around each time the page is loaded.The Quick Submit plugin will increment the
seq
value on submissions as it builds an issue so perhaps there is some code here that can be reused. At the least, maybe the query builder for fetching submissions can also sort according tosubmission_id
so at least there is a unique value in case the sequence values are the same.Our clients who use this workaround for continuous publication have also asked us to examine sorting by the
date_published
field within the publication object, but since this field does not contain minutes and seconds it results in the same behaviour when more than one article is published on the same day.To Reproduce Steps to reproduce the behavior:
What application are you using? OJS 3.3.0.14
Additional information Issue TOC ordering and sorting is related to this other issue: https://github.com/pkp/pkp-lib/issues/8564