microsimulation / ijm

A central place for general issues, documents, scripts and resources for the IJM
https://microsimulation.org/ijm/
MIT License
3 stars 0 forks source link

Bug: opening figures on the website leads to incorrect figures #182

Closed pbronka closed 1 year ago

pbronka commented 1 year ago

Describe the bug Opening (enlarging) figures included in articles on the website opens incorrect figure, usually the last one provided for a given article.

Steps To Reproduce Open https://microsimulation.pub/articles/00273/figures, click on the first figure. A different figure is opened.

Expected behavior Correct figure should be opened.

Screenshots If applicable, add screenshots to help explain your problem.

pbronka commented 1 year ago

Hi @gnott, do you think this might be some issue with the conversion or XML files / file names? It seems to affect all articles.

gnott commented 1 year ago

I don't know too much about the web front-end software, and at first I couldn't see a reason, assuming on the example article the figure viewer was scrolling to the last figure on the page to show in the modal window. Until I looked at other articles, for exxample https://microsimulation.pub/articles/00210/figures works well.

I think I've traced it back to the XML data. In ijm-00273.xml, there are two tags with the same @id attribute value: the <fig> tag for Figure 1 and the one for Figure A1..

The fig1 value ends up in the @data-asset-viewer-group="fig1" attribute of the web page <div> tag. I presume the image viewer uses these to determine which images are part of the same group.

If my guess is correct, I would suggest to fix this is for there to be no duplicate @id attributes in each of the article XML files. I could convert them to JSON again, however you could also probably just manually fix the JSON files accordingly, if you know which needed to be fixed.

pbronka commented 1 year ago

Thank you very much! I tested your proposed solution in #183 and it seems to fix the problem. We will go through all articles and update json file and I will ask Exeter to stop reusing the same @id attributes.

pbronka commented 1 year ago

Checked all articles and updated the ones with errors in #184. Exeter confirmed they will fix this going forward, so closing.