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

Sometimes an error message appears when saving the diagram #59

Closed
ane-gabriela opened this issue Aug 28, 2019 · 9 comments
Assignees
Milestone

Comments

@ane-gabriela
Copy link

@ane-gabriela ane-gabriela commented Aug 28, 2019

I could't find a clear pattern for this issue but while testing the Diagram app I've noticed that sometimes after I add a shape and click Save & View the "Error when saving the diagram as an image attachment" message appears.

Screenshot_1

There is no error message in the XWiki console. If clicked again, the diagram is saved properly.

This happened on Chrome 76 and Edge 18 on XWiki 10.11.8 and 8.4.5

@ane-gabriela ane-gabriela added this to the 1.7.1 milestone Aug 28, 2019
@acotiuga acotiuga modified the milestones: 1.7.1, 1.8 Aug 29, 2019
@mflorea

This comment has been minimized.

Copy link
Collaborator

@mflorea mflorea commented Aug 29, 2019

@oanalavinia could you look into this when you have some time? Thanks.

@oanalavinia

This comment has been minimized.

Copy link

@oanalavinia oanalavinia commented Sep 2, 2019

@mflorea Sure.

oanalavinia added a commit to oanalavinia/application-diagram that referenced this issue Sep 10, 2019
* create blob from svg instead of canvas, since canvas.toBlob is not supported in IE
@oanalavinia

This comment has been minimized.

Copy link

@oanalavinia oanalavinia commented Sep 11, 2019

This issue is caused by the fact that 'toBlob' method is not fully supported https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob#Browser_compatibility
As a result the diagram is not saved at all on these browsers, since the save process is paused until the attachment is added.

oanalavinia added a commit to oanalavinia/application-diagram that referenced this issue Sep 17, 2019
* don't save the image attachment when toBlob is not supported, since there is no valid way to get canvas from svg in IE
oanalavinia added a commit to oanalavinia/application-diagram that referenced this issue Sep 17, 2019
oanalavinia added a commit that referenced this issue Sep 17, 2019
Sometimes an error message appears when saving the diagram #59
@oanalavinia

This comment has been minimized.

Copy link

@oanalavinia oanalavinia commented Sep 17, 2019

There is no valid way to get the image attachment in IE without a SecurityError. As a result, for these cases the pdf export, when having a private wiki, won't work (the changes done to the diagram will be saved, without saving the attachment).

  • in case it will be a requested feature, we could save the diagram as an svg attachment (only when toBlob is not defined) and use it for export. The problem with this approach is that inserted text won't be displayed (because FOP is not supporting html inside svg)
  • investigation: even if it is to convert manually the canvas to Blob, it will still throw a SecurityError; using 'drawImage' for inserting the image into the canvas, is tainting it in the POV of IE, not having the possibility to get dataUrl after; a discussion on this subject could be found in here https://stackoverflow.com/questions/27230293/how-to-draw-an-inline-svg-in-dom-to-a-canvas/33227005#33227005
@ane-gabriela

This comment has been minimized.

Copy link
Author

@ane-gabriela ane-gabriela commented Sep 25, 2019

Tested on 8.4.5, 10.11.9 (Cloud) and 11.7 with Edge 18 and IE 11 - same results, the attachment is not saved anymore.

@mflorea

This comment has been minimized.

Copy link
Collaborator

@mflorea mflorea commented Sep 30, 2019

@ane-gabriela but the diagram itself is saved right? I mean, there's no error message anymore right?

@ane-gabriela

This comment has been minimized.

Copy link
Author

@ane-gabriela ane-gabriela commented Sep 30, 2019

The diagram in saved in the XWiki page. Just the attachment is not present anymore.

@mflorea

This comment has been minimized.

Copy link
Collaborator

@mflorea mflorea commented Sep 30, 2019

Just the attachment is not present anymore.

This is the expected behavior (for now) on IE. @oanalavinia explained above the reason.

@ane-gabriela

This comment has been minimized.

Copy link
Author

@ane-gabriela ane-gabriela commented Sep 30, 2019

Yes, she mentioned IE. My comment above was to mention that it is the same behavior on Edge 18 (to have this info for future references)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.