xwikisas / macro-pdfviewer

0 stars 4 forks source link

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

Closed js-ddev closed 3 years ago

js-ddev commented 3 years ago

Steps to reproduce on version 2.2.1

  1. Upload a PDF file on the wiki, here file-sample.pdf
  2. Create another page
  3. On this new page, use the PDF viewer macro and search for the file uploaded in point 1 using the picker from the File field 1-UI
  4. The code created looks like this: {{pdfviewer file="Clients.Office and PDF import.PDF viewer import.WebHome@file-sample.pdf"/}}

Using the Document field to add the reference of the page on which the PDF file is stored doesn't fix the issue, displaying the same kind of error: The file attachment [Clients.Office and PDF import.PDF viewer import.WebHome@file-sample.pdf] does not exists in document [test1:Clients.Office and PDF import.PDF viewer import.WebHome].

The File field is always wrong using the UI, as the good code to display this file is this one: {{pdfviewer file="file-sample.pdf" document="Clients.Office and PDF import.PDF viewer import.WebHome"/}}

The issue here is that the UI misleads the user by proposing a picker of existing PDF files on the wiki. AFAIK on this version of the application the UI doesn't allow to display a PDF file located outside the current page, you have to use an absolute link, or edit the macro code in source edit.

oanalavinia commented 3 years ago

Introduced by #14