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

Publication Content Type is double-encoding spaces in a file name URL leading to a 404 #2417

Closed
JoeLutovsky opened this issue May 18, 2023 · 0 comments · Fixed by #2430
Closed
Assignees
Labels
bug Something isn't working patch release Issues to be included in the next patch release

Comments

@JoeLutovsky
Copy link

JoeLutovsky commented May 18, 2023

Problem/Motivation

Publication Content Type URL is not working properly:

Example publication with this issue: https://sbar.arizona.edu/publication/guayule-growth-yield-responses-deficit-irrigation-strategies-u-s-desert

Describe the bug

If you click on the main link in the body of this publication it leads to a 404. It should be linking to the PDF that's attached to the Publication content type.

To Reproduce

Steps to reproduce the behavior:

Add a file with spaces in the filename to the Publication File field in a publication.

Proposed resolution

I was discussion this on Slack with Dana and Brian.

Brian said:

"The problem appears to be that the spaces in the filename are being encoded twice: first the space characters were encoded as %20 and then those instances of %20 were encoded again as %2520, since %25 is the code for %. If you edit that broken URL to change the spaces back to %20, the file will load successfully.
I’m not sure how the link is being encoded twice, but maybe this line in az_publication.module needs some attention. Here is the source for that createFileUrl function."

Expected behavior

Link should lead to the attached PDF and not a 404.

Screenshots

If applicable, add screenshots to help explain your problem. (Need a tool to share screenshots or screencasts as URLs? Try monosnap

Desktop (please complete the following information):

  • OS: Windows and MacOS
  • Browser: all

Additional context

Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working patch release Issues to be included in the next patch release
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants