ID number in file name and galley link do not match

Hi there, in OJS 2.4.7.1, we see something unexpected regarding file numbers and galley links. We were running a script to apply metadata and license stamps on the first pages of all PDF files, when we noticed the following:

  • For the first 40 or so issues, the galley number in links, i.e. 5672 in …/index.php/[journal]/article/view/3745/5627 equals the number in the file name in the journal’s galley directory, i.e. …galleys/journals/1/articles/3745/public/3745-5627-1-PB.pdf

  • For newer issues, the two numbers are not identical - so the id number in a galley link is different from the file name actually being displayed or downloaded.

While we are not interested in fixing this retrospectively, we would like to fix this for future XML imports.

My guess is that through errors in XML uploads, two counters for files and galley database entrys got out of sync. To avoid messing around in the database, any advice on how to fix this without changing existing article and galley links would be very helpful. Thanks!

Hi @ojsbsb,

Are you maybe looking at the wrong ID? The ID in the filename is the file_id from article_files, not the galley_id, I think.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks @asmecher, I was assuming that the id numbers for galleys and files were identical.

Hi @ojsbsb,

They’re different IDs – but you can get from the galley_id to the file_id; both are in the article_galleys table.

Regards,
Alec Smecher
Public Knowledge Project Team