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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

matt_paz created an issue. See original summary.

matt_paz’s picture

Issue summary: View changes
matt_paz’s picture

Issue summary: View changes
matt_paz’s picture

Category: Support request » Bug report

@berdir suggested i open a bug ticket ...
https://drupal.stackexchange.com/questions/243780/can-i-create-a-url-ali...

"I'd say this is a bug and the priority of the service definitions should be adjusted for this. That is path_processor.files (currently 200) and path_processor_alias ( currently 100). Setting the first to 99 and clearing caches makes it work for me.

I'd suggest you open a core issue for this, I suspect nobody tried this yet."

matt_paz’s picture

Priority: Minor » Normal
matt_paz’s picture

The attached patch adjusts the priority of path_processor.files (relative to path_processor_alias)

Berdir’s picture

Status: Active » Needs review
matt_paz’s picture

matt_paz’s picture

wizonesolutions’s picture

Issue tags: +Vienna2017

I'm mentoring @jhuhta on this issue

jhuhta’s picture

Tested and works: got 404 before the patch, after applying and clearing cache the alias worked ok. +1

mradcliffe’s picture

Is 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.

rachel_norfolk’s picture

This 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.

jhuhta’s picture

Issue summary: View changes
valthebald’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

Agree with @mradcliffe

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

larowlan’s picture

Is this a bug or a missing feature?

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

matt_paz’s picture

I guess I thought of it as a bug, but perhaps it should be reframed as a feature request.

matt_paz’s picture

Version: 9.5.x-dev » 11.x-dev
Category: Bug report » Feature request