Deleting a galley removes submission file references from an unrelated article (OJS 3.4.0-5)

Environment

OJS 3.4.0-5
MySQL 8.0
Apache

Description

We observed multiple cases where deleting a galley from one submission caused the PDF file of a completely different submission to disappear.

The affected users report that they never edited the article whose PDF later disappeared.

We were able to correlate:

  • Apache access logs
  • MySQL binary logs
  • OJS event logs
  • Database backups taken before the incident

and found the same pattern in multiple independent cases.

Case 1

User was working on:

submissionId = 1192
publicationId = 1193

Access log:

POST …/article-galley-grid/delete-galley
?submissionId=1192
&publicationId=1193
&representationId=850

followed by the normal workflow:

delete galley
add galley
upload replacement PDF
publish

The user did not access submission 1143.

However, MySQL binlog shows:

UPDATE publication_galleys
galley_id = 802
publication_id = 1144
submission_file_id: 1472 β†’ NULL

where:

submission 1143
publication 1144
galley 802
submission_file_id 1472
file_id 850

The PDF of submission 1143 disappeared.

Case 2

User was working on:

submissionId = 1201
publicationId = 1202

Access log:

POST …/article-galley-grid/delete-galley
?submissionId=1201
&publicationId=1202
&representationId=859

Again, the user was replacing a galley:

unpublish
delete galley
add galley
upload replacement PDF
publish

The user did not access submission 1149.

However, MySQL binlog shows:

UPDATE publication_galleys
galley_id = 808
publication_id = 1150
submission_file_id: 1487 β†’ NULL

where:

submission = 1149
publication = 1150
galley = 808
submission_file_id = 1487
file_id = 859

The PDF of submission 1149 disappeared.

Observed pattern

Case 1:

deleted galley_id = 850
affected file_id = 850

Case 2:

deleted galley_id = 859
affected file_id = 859

In both cases:

delete-galley representationId = X

was immediately followed by removal of a submission file belonging to another submission where:

file_id = X

This suggests a possible confusion between galley_id and file_id during the galley deletion workflow.

Evidence

We can provide:

Apache access logs
MySQL binlogs
Database dump before the incident
Event log entries

showing that:

  1. the user was editing submission A,
  2. delete-galley was executed on submission A,
  3. submission B lost its PDF immediately afterwards.

Question

Is there any known issue in OJS 3.4.0-5 where deleting a galley can incorrectly remove submission-file references belonging to another article, especially when:

galley_id == file_id

across unrelated records?

Any guidance on reproducing or investigating this would be greatly appreciated.

Hi @zieglcar,

This is issue #10758, resolved in OJS/OMP/OPS 3.4.0-9 and later. I recommend upgrading to the latest release (and in general, staying up to date).

Regards,
Alec Smecher
Public Knowledge Project Team