Reviewed & tested by the community
Project:
Sub-pathauto (Sub-path URL Aliases)
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
23 Apr 2018 at 22:57 UTC
Updated:
27 Jun 2026 at 17:02 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
lemuelsantos commentedComment #3
lemuelsantos commentedComment #4
lemuelsantos commentedComment #5
nkoporec\Drupal::config('subpathauto.settings')->get('blacklist');\Drupal::service('path.matcher')->matchPath($path, $pattern)Please inject services using dependency injection.Otherwise, the patch applies cleanly.
Comment #6
hlopes commentedThe patch only works for inbound links.
Comment #7
hlopes commentedChanged the line where isValidPath verification is made
And tweaked the pathmatcher, it expects a string, no need for a foreach.
Comment #8
RumyanaRuseva commentedComment #9
lobsterr commented1) I have rerolled the path
2) I also noticed that patch handles only only inbound processing, but not outbound. I added this case also
3) I updated all the tests for inbound and outbound cases to check blacklists.
4) Another small fix here is local task, which is not displayed, because we are missing route, I change it to 'entity.path_alias.collection'. I believe it is the most suitable place for it.
Comment #10
nickdickinsonwildeI very much am in favour of the least configurable settings possible to meet the majority use case. This setting is clear and harmless in it's default empty state and provides a potentially very useful option so I'm in favour of the feature.
That said, this is a new feature so have a strong feeling that we shouldn't be using 'blacklist' - see also #2993575: [meta] Remove usage of "blacklist", "whitelist", use better terms instead in core with regards to existing features where it is way more complicated and compatibility issues etc. I think ignorelist would be clearest - and then can use nice verb tenses like ignored etc.
Additionally, does need a re-roll due to other changes committed in the last couple weeks.
Comment #11
lobsterr commented1) Rerolled the patch
2) Replace blacklist with denylist
3) We still call "path_alias.whitelist", but it comes from path_alias module
Comment #12
nickdickinsonwildeThanks! I like it. Going to leave open for a few days and if no one else has opinions I'll probably commit it early next week.
Comment #14
urvashi_vora commentedHi @LOBsTerr,
Tested the patch, it applied cleanly.
@NickDickinsonWilde, committing the changes to save your time and efforts.
Thanks
Comment #16
lobsterr commented@NickDickinsonWilde Can we already merge it ?
It also would be nice to have a new release tagged.
Thanks
Comment #17
mistergroove commentedHey. Great work on this guys. Have been using the solution in https://www.drupal.org/project/subpathauto/issues/2964786 till now but don't think I can use it on the 10 compatible version.
Did this make it into the official release yet?
Comment #18
loon commentedIt is not possible to exclude 'node/*/edit' pages
Updated patch #11
Comment #19
batigolixThanks for this great feature.
I had some trouble understanding how it worked, so I think this needs a bit of documentation and some clearer UI texts.
I would change the label to:
"Ignore the following paths"
And I would change the description to:
"These paths will be ignored by subpathauto. Use for example '/node/*/edit' to ensure that subpathauto ignores the node edit path. You can use wilcards(*). Start each path with a forward slash '/'. Enter one path per line."
I've read you discussed how to name the list and you settled for Denylist. Would "Ignore list" not be a better name for this?
Comment #20
batigolixComment #21
kevin w commentedThe patch is very helpful! For a URL like /part1/part2, if /part1 is redirected to /new-part1, I can't stop the redirection from /part1/part2 to /new-part1/part2. Adding some lines in processInbound() to skip /part1/part2 works.
Comment #22
kevin w commentedAdded the check for denyList at the start of processInbound(). This helps address the issue when /part1 and /part1/* should be redirected except a unique path like /part1/special_path_here.
Comment #23
mistergroove commentedGreat patch @kevin-w. Did anyone re-roll this patch for 1.4 by any chance?
I need a way to keep /node/*/edit paths excluded. It would be great if this could be part of the module.
Comment #24
lobsterr commentedGuys, please provide an interdiff every time you change something, it is impossible to follow your changes. I will reroll it, but since this moment we will switch to MR
Comment #25
lobsterr commentedSo, I have rerolled the latest patch and also renamed denylist to ignore. As it was suggested in here
Please use PR from this point
Comment #26
batigolixI reviewed this and it works good.
The UI is also much clearer now.
There was a small code mistake though that I fixed. See my last commit in the PR.
Comment #27
batigolixComment #28
lazzyvn commentednewest patch for dev branch
Comment #29
batigolix@lazzyvn please see the merge request for any changes.
Personally, I think the generic solution provided in this issue is better than the specific solution proposed in #2830425: Add option to ignore admin paths
I tested the MR and it works well.
Comment #30
alorencWorks fine to me. Can this be released?
Comment #31
claudiu.cristeaLeft an improvement remark in the MR to be reviewed.
Comment #32
claudiu.cristeaI still have a remark. If fixed I think this is RTBC
Comment #33
batigolixI made the change.
The pipeline fails on phpunit, but the errors seems unrelated to the changes in this MR.
Issue for the phpunit pipeline error is #3606780: testProcessOutbound fails on Drupal 11.1+
Comment #34
claudiu.cristeaThank you.
Comment #35
batigolix