Problem/Motivation

User story

As a user granted with "administer redirects" I want to be able to create a redirect from a dead private file link /system/files/file.txt, to the new public location of the file, in order to avoid broken links.

Actual behavior

Such a redirect responds with 404. The bug is proved by the attached patch.

The problem is that \Drupal\system\PathProcessor\PathProcessorFiles::processInbound() splits the incoming path /system/files/file.txt in:

  1. Path: /system/files
  2. Query string parameter "file": file.txt

Proposed resolution

Fix it.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Comments

claudiu.cristea created an issue. See original summary.

claudiu.cristea’s picture

StatusFileSize
new3.7 KB
new2.53 KB

The fix.

claudiu.cristea’s picture

Show the failing test patch.

claudiu.cristea’s picture

StatusFileSize
new3.79 KB
new1.44 KB

Improve a little bit the docs.

marcoscano’s picture

Status: Needs review » Reviewed & tested by the community

Manually tested this.

- Can reproduce the bug with current HEAD
- Patch applies cleanly
- Cannot reproduce the bug anymore after applying #4.

Also reviewed the code, but once I'm not familiar to the module can't add much there. Looks good to me though!

Thanks!

claudiu.cristea’s picture

Assigned: claudiu.cristea » Unassigned

Unassigning.

berdir’s picture

Status: Reviewed & tested by the community » Fixed

A bit hacky, but so is core in dealing with this.

Committed, thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.