xwikisas / macro-pdfviewer

0 stars 4 forks source link

File picker field prevent from displaying file outside the current page #22 #23

Closed oanalavinia closed 3 years ago

oanalavinia commented 3 years ago
mflorea commented 2 years ago

@oanalavinia I'm not sure you changes cover the use cases we discussed. In your comment in the source code you mention correctly (expect for "full" part) that:

The file macro parameter can hold either only the attachment name for xwiki versions below 11.5, or the full attachment reference on newer versions

but then you resolve the value as an attachment reference, always. So basically, contrary to your comment, you consider the value to always be an attachment reference. This breaks the file name use case when the file name has special characters, such as @ which will be handled specially by the reference resolver.

IMO you need to first try to use the value as is as file name, and then try to resolve it as an attachment reference.

oanalavinia commented 2 years ago

@mflorea I tried to make the fix just specific to this issue, as a quick fix (since we discussed only after), and cover the full problem in #24 Since what was done for #24 also changes this fix, I don't think this PR is relevant. I would specify that #22 was fixed along with #24

mflorea commented 2 years ago

Yes, you can ignore my comment. I've seen #24 later.