Broken images in XML after updating

Hello everyone,

I am in the same situation as presented in this thread: OJS and images attached to XML I upgraded from OJS 3.3.0.14 to OJS 3.4.0.6 (PHP 8.3) and the images (IMAGE) in my XML are not showing, apparently the path it encodes is not correct.

This is the console error:


image

Can you help me with this situation? Please.

Hi @Elena_Najera,

Where are you images uploaded to on your server?
A recommended practice is uploading them as dependent files. Depending on how your OJS instance is configured, you may have to have your components figured properly:
https://docs.pkp.sfu.ca/learning-ojs/en/settings-workflow#components

-Roger
PKP Team

Hello, @rcgillis

Thank you for your reply. They are as dependent files and are saved once they are loaded into the OJS file directory, prior to the upgrade to OJS 3.4.x they were displayed correctly.

It could be something like what was solved here (Links to dependent files referenced in HTML/JATS XML galleys are broken · Issue #6801 · pkp/pkp-lib · GitHub) but now required for OJS 3.4.0.6

Thanks for pointing this out. If you’re running 3.4, this issue should be addressed - @Vitaliy - do you know if this is the case?

-Roger
PKP Team

1 Like

Dear @rcgillis I appreciate the reference, unfortunately it has not been possible to solve the issue of broken images in the Viewer because of the path they have.

I welcome any comments from @Vitaliy

Regards,

Hi all,

See also (with a proposed fix):

https://github.com/asmecher/lensGalley/issues/68#issuecomment-2499206506

Regards,
Alec Smecher
Public Knowledge Project Team

2 Likes

Hi @asmecher

I confirm that the proposal has fixed this issue.Thank you very much for all the support and response.

Regards

Hi @Elena_Najera,

Excellent, thanks for confirming! I’ll include the fix in the next 3.4.0-x release, which might be as soon as this week.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher

It seems to me that we have to do one more validation, now XMLs that do not contain images mark “Error during loading. Please try again. But, the ones that contain images load correctly and show the image. Is it possible that the patch directly affects XML without Figures?

Regards,
Elena Cruz.

Hi @Elena_Najera,

I don’t see a connection, looking over the code. Do you get a message in the PHP error log?

Regards,
Alec Smecher
Public Knowledge Project Team

Hello @asmecher

I appreciate the support. This returns the log error

2024/12/03 18:17:33 [error] 425323#425323: *501307 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to a member function getData() on null in /plugins/generic/lensGalley/LensGalleyPlugin.php:291
Stack trace:
#0 plugins/generic/lensGalley/LensGalleyPlugin.php(201): APP\plugins\generic\lensGalley\LensGalleyPlugin->_getXMLContents()
#1 [internal function]: APP\plugins\generic\lensGalley\LensGalleyPlugin->articleDownloadCallback()
#2 lib/pkp/classes/plugins/Hook.php(139): call_user_func_array()
#3 lib/pkp/classes/plugins/Hook.php(113): PKP\plugins\Hook::run()
#4 pages/article/ArticleHandler.php(483): PKP\plugins\Hook::call()
#5 [internal function]: APP\pages\article\ArticleHandler->download()
#6 lib/pkp/classes/co" while reading response header from upstream

This is the only message for now. Thank you very much, best regards.

Hi @Elena_Najera,

Unfortunately you’re right – another tweak was required. It’s documented here:

https://github.com/asmecher/lensGalley/issues/68#issuecomment-2518773009

This next fix will come out with OJS 3.4.0-9, but meanwhile you can apply the change there manually.

Regards,
Alec Smecher
Public Knowledge Project Team

Hello @asmecher

I really appreciate all the support and help. I confirm that this patch fixed it correctly.

Thank you. Regards,

1 Like

Thanks, @Elena_Najera!

This topic was automatically closed after 13 days. New replies are no longer allowed.