xwikisas / application-diagram

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

Warning message when creating a diagram from an existing page using the {{diagram/}} macro #279

Closed rstavro closed 1 week ago

rstavro commented 3 weeks ago

Steps to reproduce the issue :

  1. Insert the diagram macro in the content of a page
  2. Click on Save & View
  3. Click on "Create diagram" macro

At this point, when the edit mode loads, a warning message is displayed above the editor saying :

"Warning: For security reasons, the content of the edited document is executed in restricted mode, as the edit was not initiated by a validated request. There may be unexpected errors due to this."

Marius explained to me that the form_token might be missing from the diagram creation form. I checked and the creation button is a link of this form :

<a class="diagram-create btn btn-default" href=".../mywiki/edit/MyLocation/MyPage/Diagram?template=Diagram.DiagramTemplate">
Create diagram
</a>

When adding form_token in the URL of the edit mode : .../edit/MyLocation/MyPage/Diagram?template=Diagram.DiagramTemplate&form_token=x9p0zknX4ZAwTxxkoJcysQ , then the warning message goes away.

I reproduced this issue with Diagram Pro version 1.19.4 .

ChiuchiuSorin commented 2 weeks ago

@rstavro I could not reproduce the issue by following the steps. I tested it on XWiki version 14.10 and diagram versions 1.19.4 and 1.20.5. What XWiki version did you use and was there an additional step you did prior to this issue?

lamblinc commented 1 week ago

@ChiuchiuSorin as far as I know it's o 14.10.20