Problem/Motivation
Currently it's impossible to add url alias for a private file.
Proposed resolution
Adjusts the priority of path_processor.files below 100 so that the request gets processed.
Remaining tasks
Write tests.
User interface changes
None
API changes
None
Data model changes
None
Original report by [matt_paz]
Should we be able to add a url_alias (from /admin/config/search/path) for a private file?
Right now it allows me to add an alias (and I can see that it is being rendered in the front end) but it generates a 404.
In my particular case the path for the uploaded file is ...
/system/files/2017-08/1.pdf
Comment | File | Size | Author |
---|---|---|---|
#9 | 2902069-9-allow_url_alias_on_private_files.patch | 566 bytes | matt_paz |
| |||
#6 | system.services.yml.diff | 923 bytes | matt_paz |
Comments
Comment #2
matt_paz CreditAttribution: matt_paz commentedComment #3
matt_paz CreditAttribution: matt_paz commentedComment #4
matt_paz CreditAttribution: matt_paz commented@berdir suggested i open a bug ticket ...
https://drupal.stackexchange.com/questions/243780/can-i-create-a-url-ali...
Comment #5
matt_paz CreditAttribution: matt_paz commentedComment #6
matt_paz CreditAttribution: matt_paz commentedThe attached patch adjusts the priority of path_processor.files (relative to path_processor_alias)
Comment #7
BerdirComment #8
matt_paz CreditAttribution: matt_paz commentedComment #9
matt_paz CreditAttribution: matt_paz commentedRe-uploading to use proper naming conventions.
Comment #10
wizonesolutionsI'm mentoring @jhuhta on this issue
Comment #11
jhuhta CreditAttribution: jhuhta commentedTested and works: got 404 before the patch, after applying and clearing cache the alias worked ok. +1
Comment #12
mradcliffeIs it worth having a test?
It would be nice, if not including any additional test coverage, to have some screenshots for manual testing, @jhuhta. Could you update the issue summary and add screenshots there?
This also might need to be for 8.5.x. I'm not sure if it's RC target. It seems like a pretty minor change and OK based on Allowed changes during the Drupal 8 and 9 release cycles.
Comment #13
rachel_norfolkThis looks interesting - remember to update the Issue Summary to use the Issue Summary Template. It really helps the Core Committers understand the issue quickly and easily.
Comment #14
jhuhta CreditAttribution: jhuhta commentedComment #15
valthebaldAgree with @mradcliffe
Comment #23
larowlanIs this a bug or a missing feature?
Comment #25
matt_paz CreditAttribution: matt_paz commentedI guess I thought of it as a bug, but perhaps it should be reframed as a feature request.
Comment #26
matt_paz CreditAttribution: matt_paz commented