After migrating from version 2.4 to 3.2.0 in some publications, the images using the lens.js plugin do not show the images.
When reviewing the code I found that it generates the url of the image but when copying the URI it shows me a 404 error.
What is the path where you upload the files? because the file is in files / journals /… / submission / proof
Could you guide me to solve the problem, thanks.
Cannot reproduce this on a clean 3.2.0 instance. Can you specify the version of the plugin?
The path looks correct at first glance, it’s
article page and
download operation. The first number should be a submission id, second - galley id and the last - file id. Checkout
ArticleHandler::download for more details.
You are right, the actual path is inside the
proof folder. It should be somewhere in:
journals/1/articles/168/submission/proof with a prefix like:
1 after journals is the journal id and 168 after articles the submission id.
The lensGalley plugin is version 184.108.40.206 where ojs 3.2.0-3 comes from.
In the proof folder there is no named image containing 168-10-683
Checking well I found that it generates the image url and the xml well but it doesn’t show when to start the xml view.
Clarification: Those not found were from a previous publication
I get the following log in the web browser console "FIXME: isn’t fnElem.getAttribute (id) === fnId?"
Can you guide me with this message
I would say that it’s a more general problem with files migration. Have you encountered any errors during upgrade? Were there suspicious warnings?
I don’t know much about upgrades from OJS 2+, maybe @ajnyga knows more.
In the database, what tables should intervene to display the images? In version 3.2.0
To create a link Lens Plugin uses download operation from ArticleHandler. Take a look here: lensGalley/LensGalleyPlugin.inc.php at 0007889b4f1e6c46526986a29d54a3e43d22a132 · asmecher/lensGalley · GitHub and here: ojs/ArticleHandler.inc.php at a717d40b3b531618c0fcbfb2c87ff88e347a78ca · pkp/ojs · GitHub
As you can see to construct a proper URL submission id, galley id, and file id are used. According to the
ArticleHandler::download if all conditions are met (e.g., user can view galley, galley has a file with a correspondent id, etc.),
SubmissionFileManager is called to process the download.
Construction of the actual file path can be found in
SubmissionFile::getFilePath(): pkp-lib/SubmissionFile.inc.php at b4a4a046d7d8fa36e7035c90a860bc8578640844 · pkp/pkp-lib · GitHub. Take a look at what this method returns:
$submissionFileManager->getBasePath() . $this->_fileStageToPath($this->getFileStage()) . '/' . $this->getServerFileName();
- The first part of concatenated string is a path to the submission folder, e.g.:
- The second part if a file stage: take a look at constants defined in
- The third part is a server-side file name. According to the code this last part is generated from different parts of data associated with a file: pkp-lib/SubmissionFile.inc.php at b4a4a046d7d8fa36e7035c90a860bc8578640844 · pkp/pkp-lib · GitHub. This data can be found in
Is this what you are looking for?
I still can’t find the problem. Clicking on the link in figure 1 shows me the following message:
ContainerPanelView.scrollTo(): Unknown resource 'figure_1’
After generating the url of the image, what is the next step to visualize?
I found that the uri of the first image is not generated.
But yes the second image
That looks like a different problem from discussed above. Can you confirm that image file with the original filename
81961489005_gf3.png is attached to the XML?
If so, can you look at the
submission_files table and find the file by
assoc_id columns? The latter is the
file_id of the XML file the image is attached to. E.g.:
SELECT * FROM submission_files WHERE original_file_name = '81961489005_gf3.png' AND assoc_id = 'the ID of the XML file'. Let me know if you need help finding this ID.
I’d check if the file is in the database and its
file_stage (should be
Thanks was a problem with the original_file_name.
Returning to the original problem where images are not shown in some publications.
I found that if I add a table in the XML file the images are displayed but not when only the “fig” tags are added to the file.
<fig id="gf2" position="anchor" fig-type="plate" orientation="landscape">
<title>Diferencias entre la prevención de riesgos penales y laborales</title>
<alt-text>Figura 2 Diferencias entre la prevención de riesgos penales y laborales</alt-text>
<graphic xlink:href="581961489005_gf3.png" />
<attrib>Fuente: Elaboración propia</attrib>
How could this problem be solved? I am using lensGalley plugin
This may help:
Seems that adding a
tag inside the tag makes the “Figures” tab to appear…