[SOLVED] OJS 3.1.1 missing image files from galley

Hi there,

This is related to this discussion but I need some specific guidance around the missing images, and not the metadata changes by authors.

I upgraded a site from to 3.1.1 a while ago, and today the editor mentioned they can’t see the images in the preview of an unpublished article. They can upload the images successfully to the galley, and the files are indeed on the OJS server in the /submissions/proof folder for the article. Digging around further, I see that most (but not all, which seems weird) of the images in previously published articles do not resolve now either.

I read through this ticket to see if I need to apply any source code changes. I see that 3.1.1 already has the patched source code, apart from adding the /tools/fixGalleyImages.php script. I therefore added that script and tried to run it, but it of course gave the error “submission_html_galley_images doesn’t exist” because that table was deleted during the upgrade to 3.1.1 if I understand correctly.

Do I need to upgrade to from 3.1.1 to fix the galley image loading issues?



I accidentally posted this to “Uncategorized” - hopefully now that it’s in the right category someone can assist. =)



Hi @gfaulkner

To what version did you upgrade directly from exactly, directly to
It seems like you have two issues: one with the new uploaded images and one with those migrated from 2.4.8.
Could you give me an example of your file and image, possibly one that was newly uploaded and one that was migrated from 2.4.8, i.e.:
– as editor do you see the image in the galleys grid, as dependent file of an HTML galley?
– what is the image file name and path in the files folder?
– could you also take a look in your DB table submission_files, find that image file entry and tell me how it looks like?
– double check, especially for the newly uploaded images: is the original file name exactly the same as referenced in the HTML document?


Hi Bozana,

Thanks for your response. Here are some details that hopefully will help.

We migrated from (not as previously reported) to directly.

Here’s an article from the current issue of the journal http://cjds.uwaterloo.ca/index.php/cjds/article/view/421 that is the first issue published since upgrading to OJS 3.1.1. The HTML version of the article has image tags that reference the original file names: Article1-Figure1.png, Article1-Figure2.png, and Article1-Figure3.png, respectively.

The data in the submission_files table for submission_id = 421 shows that the original_file_name is indeed those values. They have a file_stage of 17.

| submission_id | assoc_id | file_id | revision | file_type       | original_file_name                      | file_stage | date_modified       |
|           421 |     NULL |    1351 |        1 | application/pdf | Article_1_Parekh_Giftedness_FINAL-s.pdf |         11 | 2018-07-19 09:52:55 |
|           421 |     NULL |    1364 |        1 | text/html       | Article 1 Parekh Giftedness.html        |         11 | 2018-07-19 15:30:14 |
|           421 |      659 |    1377 |        1 | application/pdf | Article_1_Parekh_Giftedness_FINAL-s.pdf |         10 | 2018-07-19 15:47:13 |
|           421 |     1416 |    1418 |        1 | image/png       | Article1-Figure2.PNG                    |         17 | 2018-07-24 10:56:08 |
|           421 |     1416 |    1419 |        1 | image/png       | Article1-Figure3.PNG                    |         17 | 2018-07-24 10:56:22 |
|           421 |      688 |    1416 |        1 | text/html       | New Article 1 Parekh Giftedness.html    |         10 | 2018-07-24 10:55:20 |
|           421 |     1416 |    1417 |        1 | image/png       | Article1-Figure1.PNG                    |         17 | 2018-07-24 10:55:50 |

The images are dependants of the HTML galley within that article.

In the /home/cjds/files/journals/1/articles/421/submission/proof/ folder, here are the files:


I hope this helps clarify things.


EDIT: Here are the articles which now have broken images after the upgrade. As per the new article mentioned above, they each reference the correct original file name listed in the database.


As well, for further info, for article #110, the files available in /home/cjds/files/journals/1/articles/110/submission/proof/ are:


Hi @gfaulkner

Hmm… I think your HTML code does not contain totally/100% correct original file name: In the first example, the original file names contain .PNG (in capital letters) and in the HTML is .png (in lower case letters). In the second example, article 110, HTML galley 224: the HTML code contains URL escaped characters, which might be not the case for the original file name.
Thus, could you please adapt the HTML code i.e. the original file names in those two examples and see if this helps?
When the system i.e. HTMLGalley plugin correctly finds the names in the code, they will be replaced with the correct OJS file URLs, something like: src=“http://http://cjds.uwaterloo.ca/index.php/cjds/article/download/421/688/1417”


Hi Bozana,
Thanks for the response. I had noticed that difference in filenames too and attempted changing them in the HTML file to no avail. I experimented with changing the filenames for the images in the galley to use .png instead of .PNG, and also tried both .png and .PNG in the HTML file. Each time it still shows as a missing image when viewing the article.

One thing I noticed was that when the HTML file referenced [image_name].PNG, in the resulting HTML produced by OJS, it shows as [image_name].png.

Anyway, regardless of what combination I tried, in the generated HTML from OJS, it retains the original file name in the anchor, instead of transposing it to the OJS-specific file name.

One other thing I will mention is that I believe article 421 (and perhaps the other ones with image errors), were entered using the Quick Submit plugin by the looks of things.

Any further suggestions for debugging are greatly appreciated.


Hi Bozana,

I have discovered another oddity making debugging tricky.

I made some further edits to the HTML file (e.g. removed some incorrect anchor tags used in the References section). I replaced the HTML file for the article in the article submission settings, but the old version of the file is still being shown by OJS in HTML article view.

I cleared the data cache and template cache within OJS, cleared my browser cache, and restarted Apache, and the old version of the HTML is still showing when viewing the article (http://cjds.uwaterloo.ca/index.php/cjds/article/view/421/688).

However, when I view/download the file via the article submission details, the new file is indeed there and correct. So, the file permissions seem to be as required, but there is a weird caching issue somewhere (or a bug where the HTML viewer references the first version only?).

Any help is appreciated!


Hi @gfaulkner
Just to be sure: where exactly did you replace the HTML file? – Did you as editor go to the submission backend, production tab, Galleys grid, link “Change file” ?


Yes, I logged in as the editor, and used the “upload a file” and selected replace the current HTML file.



it seems like you are doing it in a wrong files grid – it has to be the Galleys grid, in the Production tab – it has no “upload file” feature…

Thanks Bozana. I finally got it working thanks to your help. Once I used the HTML galley’s “change file” and used the filename with the .PNG (instead of .png) the images show up!

Thanks again.


Hi everybody,

Hope you are doing well. I think I have a problem in images for HTML galleys in OJS 3.2.0-1
I upload images with the exact name of file names in html code. but they are not loaded:

I checked the error log and I saw these errors:

PHP Warning: Declaration of DependentFilesGridHandler::authorize($request, $args, $roleAssignments) should be compatible with SubmissionFilesGridHandler::authorize($request, &$args, $roleAssignments) in /home/ccbjourn/public_html/lib/pkp/controllers/grid/files/dependent/DependentFilesGridHandler.inc.php on line 20

ojs2: 404 Not Found
ojs2: 404 Not Found
ojs2: 404 Not Found
ojs2: 404 Not Found
ojs2: 404 Not Found
ojs2: 404 Not Found

May I ask you to help me about this?

Hi @Amin_Salehi-Abargoue,

See: Issue with embedded images in the HTML galleys in upgrading from OJS 2.4.8-1 or 3.1.2-4 to OJS 3.2.x

Alec Smecher
Public Knowledge Project Team

Hi @asmecher

Thank you for your help.