asmecher/lensGalley

Error in displaying supplementary files - img

Closed this issue · 8 comments

Hello, I extend this problem presented in the forum: https://forum.pkp.sfu.ca/t/error-al-visualizar-imagenes-actualizando-desde-version-3-3-0-14-a-3-4-0-4/86655

Problem: In version 3.4.0.4 the XML does not show the image.

In previous versions an image is uploaded as a complementary file and the URL is completed correctly:

Imagen de WhatsApp 2024-02-26 a las 16 47 32_3b994593

In version 3.4.0.4, the image loads in the same way but is not displayed. Inspecting the URL does not load correctly for the supplementary file.

2

To fix the error with version 3.4.0.4 you had to work with the file LensGalleyPlugin.php

Line 194:

if ($galley && in_array($galley->getFileType(), ['application/xml', 'text/xml']) && $galley->getData('submissionId') == $fileId)

Change to:

if ($galley && in_array($galley->getFileType(), ['application/xml', 'text/xml']) && $galley->getData('submissionFileId') == $fileId)

A wrong call

line 280:

$issue = Repo::issue()->getBySubmissionId($galley->getData('submissionId'));

$galley->getData('submissionId') da null

Change to:

//Modificación 27-07-2024 para pasar por encima error
$submissionFileAux = $galley->getFile();
$submissionIdAux = $submissionFileAux->getData('submissionId');

// Perform variable replacement for journal, issue, site info
$issue = Repo::issue()->getBySubmissionId($submissionIdAux)

Thanks, @Ppantaleo! Could you open a pull request with your proposed fix?

Thanks, @netmas and @Ppantaleo!

@withanage, could you review the attached PR?

Thanks a lot @netmas and @Ppantaleo!
@asmecher I will test the functions and come back here!

@Ppantaleo and @netmas

Sorry, my eralier request did not come properly!
I have reviewed your PR and sent some small comments. Please have a look !

@withanage, I still don't see your comments on #69 -- did you forget to finalize the review to send the comments?

In any case, I ran into this error elsewhere (on the forum) and independently fixed it before I found this issue. @Ppantaleo, please try f0b4775 and report back if it resolves the problem.

Unfortunately the above fix wasn't quite complete, as pointed out in this forum post. A further tweak was required:

1358b14

This will be released with OJS 3.4.0-9.

@asmecher Thank you, sorry for the delay.