[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 2.4.8.1 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 3.1.1.2 from 3.1.1 to fix the galley image loading issues?

Cheers,

Graham

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

Cheers,

Graham

Hi @gfaulkner

To what version did you upgrade directly from 2.4.8.1 exactly, directly to 3.1.1.0?
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?

Best,
Bozana

Hi Bozana,

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

We migrated from 2.4.8.0 (not 2.4.8.1 as previously reported) to 3.1.1.0 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:

421-10-1417-1-17-20180724.png
421-10-1418-1-17-20180724.png
421-10-1419-1-17-20180724.png
421-1-1377-1-10-20180719.pdf
421-1-1416-1-10-20180724.html

I hope this helps clarify things.

Graham

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.

http://cjds.uwaterloo.ca/index.php/cjds/article/view/110/224
http://cjds.uwaterloo.ca/index.php/cjds/article/view/172/290
http://cjds.uwaterloo.ca/index.php/cjds/article/view/352/589

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

110-10-378-1-17-20130926.png
110-10-379-1-17-20130926.png
110-10-380-1-17-20130926.png
110-10-381-1-17-20130926.png
110-10-382-1-17-20130926.gif
110-10-383-1-17-20130926.png
110-10-384-1-17-20130926.png
110-10-385-1-17-20130926.png
110-10-386-1-17-20130926.png
110-10-387-1-17-20130926.png
110-10-388-1-17-20130926.png
110-10-389-1-17-20130926.png
110-10-390-1-17-20130926.png
110-10-391-1-17-20130926.png
110-1-377-3-10-20130927.html
110-1-394-1-10-20130927.pdf

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”

Best,
Bozana

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.

Graham

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!

Graham

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” ?

Hmmm…
Best,
Bozana

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

Cheers,

Graham

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.

Graham

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:
https://ccbjournal.info/index.php/CCB/article/view/14/47

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

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher

Thank you for your help.

Regards
ASA