amnestywebsite / humanity-theme

The Amnesty International WordPress Humanity Theme
https://wordpresstheme.amnesty.org/
Other
38 stars 10 forks source link

Bug - Download Block - only one file will download from a selection #459

Open SophieAmnesty opened 3 weeks ago

SophieAmnesty commented 3 weeks ago

Describe the bug
When we try to use the download block on the Eurasia site with multiple documents, the user should be able to pick which document they want to download from the drop down list, and then click download and see it start downloading. Unfortunately, regardless of which document the user has selected, the same document always downloads - the first one in the list.

To Reproduce
Steps to reproduce the behavior:

  1. Add download block
  2. add multiple files to the download block
  3. go to front end, select a file to download (not the first one in the list)
  4. see the download isn't what you selected

Expected behaviour
users should be able to select a file from the dropdown list and download it using the download block.

Actual behaviour
we aren't able to use the download block for multiple files

Link to a page where the bug is reproduced in isolation (optional)
https://eurasia.amnesty.org/marafon-pisem-2/ (password: HRE)

Platform:
https://www.whatsmybrowser.org/b/UILZ7

Additional context
We can work around this for now with separate download buttons for each file. Also this has come up in the past and I thought I'd logged a ticket for it but I couldn't find it!!

jaymcp commented 3 weeks ago

dev note - It looks like the file URIs are incorrect - they only have the path and not the domain - so the URI validation on the frontend is failing. e.g. the URI is /wp-content/uploads/.../file.pdf instead of https://eurasia.amnesty.org/wp-content/uploads/.../file.pdf. Not sure how that's happening, and I can't repro on my local env, so will require some investigation.