[OJS 3.1.1.4] Lens can not render the XML's images using PHP 7.2

Hi everyone

I have searched in the forum the cause and solution for this issue, but neither help me to resolve this issue. However I have noticed that Lens which comes with OJS 3.1.1.4 no render the images for figures when the XML galley was created using PHP 7.2 on the server. It’s important mention that the images were uploaded to the XML galley using the edit button.

edit_xml_galley

This is the view from Lens viewer

lens_no_render_images

Using the code inspector, this is the HTML for the image, it’s important mention that 2448-718X-ete-87-345-13-gch1.gif is the name for the image in the XML file:

img_src

And when you try to see the image clicking the image icon, a 404 Not Found page was resulting:

not_found

Well I have noticed that all these happens if the XML galley was created using PHP 7.2 on the production server. But if the XML galley is created using PHP 5.6 all works correctly.

lens_render_image

image_src_correctly

As you can see in the last figures Lens renders the image, and if see in the code inspector, Lens made a chage from the original image name to an absolute path http://php56.example.com/trimestre_ojs3114/index.php/te/article/download/1029/1201/15903 for download the image.

how could be possible this? It’s possible that the mechanism of create XML galley and uploading its images is not completely compatible with PHP 7.2?

I could downgrade the PHP version on the server to PHP 5.6, but I think is not correctly solution.

Hola @juancure

Revisa este otro mensaje, parece no ser lo mismo, pero creo que es la misma situación:

A partir del séptimo mensaje planteo dos posibles soluciones, creo que te puede interesar el plugin que estoy desarrollando, aparte de arreglar ese problema dará un poco más de soporte a algunas características especificas del estilo de marcación de SciELO, lo menciono porque veo que lo estás probando con El Trimestre Económico, pero si no te interesa, revisa la solución al plugin oficial por el octavo mensaje o lo que indico más abajo.

In english (for anyone else with this problem), this may be due to a bad mime type detection, you may apply the following patch:

1 Like

Hola @ovilla, me ha funcionado los cambios que mencionas en la segunda parte de tu respuesta. Supongo que PHP 7.2 requiere el text/xml mime mientras que en PHP 5.6 era suficiente con applicaction/xml.

Con respecto a tu plugin GitHub - escire/spsLensGalley3.1: Galley viewer plugin integrating SPS Lens for OJS 3.1.x, voy a revisarlo y probarlo, gracias por responder.

Hola @juancure, que bueno que te funciono, si seguramente es porque php 5.6 asigna un tipo mime y php 7.x asigna otro tipo mime a los archivos xml y la validación anterior fallaba por eso.

De acuerdo, no hay de que.