xwikisas / application-diagram

Create various types of diagrams using draw.io
GNU Lesser General Public License v2.1
0 stars 8 forks source link

Links in the SVG of the diagram are not updated when the linked page is moved/renamed, for XWiki versions 11.10.3, 12.0 #138

Closed ane-gabriela closed 4 years ago

ane-gabriela commented 4 years ago

Steps to reproduce:

  1. Create a page eg. Page 1
  2. Create a diagram with shapes that contain text
  3. Add a link on one of the text to Page 1
  4. Move / Rename "Page 1" to "Sandbox.Moving Page"
  5. Access the diagram
  6. Observe the link to the page
  7. Click on More Actions > Export > Export as PDF
  8. Deselect all selections > Export

Expected results: The link to the page is updated with the new location and name. Related to #110

Actual results: The link to the page appears as it was initially created, it's not updated.

Environment: Windows 10, XWiki 11.10.4 with MySQL 5.7 and Chrome 81

RenamedPage

PDFExport

PDF Export xwiki_Diagram_Diagram+5_WebHome.pdf

oanalavinia commented 4 years ago

Not reproducing on 9.11 XWiki version. Seems to be only on newer versions and only about updating the SVG attachment after rename.

Workaround: a new edit + save of the diagram will update the SVG as well

oanalavinia commented 4 years ago

After some investigations this issue is a platform issue having the same cause as https://jira.xwiki.org/browse/XWIKI-17187

So this will be reproducing in XWiki versions 11.10.3, 12.0 and is fixed starting with 12.3-rc-1, 11.10.5, 12.2.2

Investigation: The issue is caused by https://github.com/xwikisas/application-diagram/blob/master/application-diagram-api/src/main/java/com/xwiki/diagram/internal/handlers/DiagramContentHandler.java#L122 where getExternalURL and getURL are not returning the right value (more details on the JIRA issue pointed above), so the new content of the attachment is not actually an updated one.