Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When renaming a diagram, the reference from the diagram macro is not updated with the new name #36

Closed
AndreeaChi opened this issue May 16, 2019 · 4 comments · Fixed by #140

Comments

@AndreeaChi
Copy link

The steps followed:

  1. On a simple page add the Diagram macro in order to display an existing Diagram.
    note: the reference name needs to contain the full path for a non-terminal diagram page: i.e. PrimaryPage.TestDiagram.WebHome and FirstPage.TestDiagram (if the diagram page is terminal)

  2. Rename the diagram page from TestDiagram to TestDiagram1

  3. View the page displaying the diagram, "PrimaryPage" once more to see that the diagram is not displayed anymore.

Current solution:
Edit the parent page in order to edit the Diagram (display) macro and update manually the new reference field with the new name of the diagram.

A similar generic ticket:
https://jira.xwiki.org/browse/XWIKI-13447 brought a fix only for "includes/display macros" . Details about the latter: https://jira.xwiki.org/browse/XWIKI-4906

@CamiAndrei
Copy link

This issue doesn't concern only the links to the diagrams used in other pages with the {diagram} macro, but also the links inserted in the diagrams. When a page is renamed, the link to it used in a diagram in not updated, the same as the links to a diagram inserted with the diagram macro in a page.

@mflorea
Copy link
Collaborator

mflorea commented Jan 23, 2020

@CamiAndrei updating the links from the diagram when a page is renamed is a separate issue.

  • Updating the reference parameter from the diagram macro is a generic problem that ideally should be fixed in the XWiki platform. It doesn't make sense to write the same page rename listener for each macro that has a reference parameter
  • On the other hand, updating the links from the diagram content can only be fixed in the Diagram application because the diagram content is not wiki syntax but an XML format specific to this application. And the way the links are saved in this XML is also specific to the Diagram application.

@CamiAndrei
Copy link

CamiAndrei commented Jan 27, 2020

Thanks @mflorea . Reported a separate ticket #110

@oanalavinia oanalavinia self-assigned this Feb 5, 2020
oanalavinia added a commit to oanalavinia/application-diagram that referenced this issue May 4, 2020
…updated with the new name xwikisas#36

* added backlink from the diagram that was referenced inside the reference parameter and on diagram page rename update the reference from all the backlinked pages
* change deprecated method
oanalavinia added a commit to oanalavinia/application-diagram that referenced this issue May 5, 2020
oanalavinia added a commit to oanalavinia/application-diagram that referenced this issue May 6, 2020
oanalavinia added a commit that referenced this issue May 6, 2020
#140)

... updated with the new name #36
* added backlink from the diagram that was referenced inside the reference parameter and on diagram page rename update the reference from all the backlinked pages
* change deprecated method
@oanalavinia oanalavinia added this to the 1.14 milestone May 6, 2020
@oanalavinia
Copy link

Note that for diagram macros registered before this fix, an additional save on the pages that hold the diagram macro will be needed (the save event is triggering the link between this page and the diagram)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants