Ignore specific paths

Created on 23 April 2018, over 7 years ago
Updated 16 February 2023, over 2 years ago

It would be nice to have a place to add specific paths that should be ignored by subpathauto. There are some times you want to ignore what subpathauto does. Just had a problem with taxonomy pages where my views were not working properly. Attached an initial patch to just ignore things for paths added through admin interface.

✨ Feature request
Status

Needs work

Version

1.0

Component

Code

Created by

🇺🇸United States lemuelsantos

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇨🇦Canada nickdickinsonwilde Victoria, BC (T'So-uke lands)

    I 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: 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.

  • Status changed to Needs review over 2 years ago
  • 🇧🇪Belgium lobsterr

    1) Rerolled the patch
    2) Replace blacklist with denylist
    3) We still call "path_alias.whitelist", but it comes from path_alias module

  • Status changed to RTBC over 2 years ago
  • 🇨🇦Canada nickdickinsonwilde Victoria, BC (T'So-uke lands)

    Thanks! 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.

  • First commit to issue fork.
  • 🇮🇳India urvashi_vora Madhya Pradesh, India

    Hi @LOBsTerr,

    Tested the patch, it applied cleanly.

    urvasi@urvasi-Inspiron-15-3552:/var/www/html/contribution/drupal/web/modules/contrib/subpathauto-2964786$ git apply -v 2964786-11.patch
    Checking patch config/schema/subpathauto.schema.yml...
    Checking patch src/Form/SettingsForm.php...
    Checking patch src/PathProcessor.php...
    Checking patch subpathauto.links.menu.yml...
    Checking patch subpathauto.services.yml...
    Checking patch tests/src/Functional/SubPathautoFunctionalTest.php...
    Checking patch tests/src/Kernel/SubPathautoKernelTest.php...
    Checking patch tests/src/Unit/SubPathautoTest.php...
    Applied patch config/schema/subpathauto.schema.yml cleanly.
    Applied patch src/Form/SettingsForm.php cleanly.
    Applied patch src/PathProcessor.php cleanly.
    Applied patch subpathauto.links.menu.yml cleanly.
    Applied patch subpathauto.services.yml cleanly.
    Applied patch tests/src/Functional/SubPathautoFunctionalTest.php cleanly.
    Applied patch tests/src/Kernel/SubPathautoKernelTest.php cleanly.
    Applied patch tests/src/Unit/SubPathautoTest.php cleanly.
    

    @NickDickinsonWilde, committing the changes to save your time and efforts.

    Thanks

  • 🇧🇪Belgium lobsterr

    @NickDickinsonWilde Can we already merge it ?
    It also would be nice to have a new release tagged.
    Thanks

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 8.1 & MySQL 5.7
    last update about 2 years ago
    20 pass
  • 🇬🇧United Kingdom mistergroove

    Hey. Great work on this guys. Have been using the solution in https://www.drupal.org/project/subpathauto/issues/2964786 ✨ Ignore specific paths Needs work till now but don't think I can use it on the 10 compatible version.

    Did this make it into the official release yet?

  • Status changed to Needs review over 1 year ago
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.2.1 + Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    20 pass
  • 🇺🇦Ukraine loon Lutsk

    It is not possible to exclude 'node/*/edit' pages
    Updated patch #11

  • 🇳🇱Netherlands batigolix Utrecht

    Thanks 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?

  • Status changed to Needs work about 1 year ago
  • 🇳🇱Netherlands batigolix Utrecht
  • 🇺🇸United States kevin w

    The path is very helpful! Should the processInbound() function also check the denyList and skip the subsequent processing if the incoming path matches one of the entries in the denyList?

  • 🇺🇸United States kevin w

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

  • 🇬🇧United Kingdom mistergroove

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

  • 🇧🇪Belgium lobsterr

    Guys, 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

  • 🇧🇪Belgium lobsterr

    So, I have rerolled the latest patch and also renamed denylist to ignore. As it was suggested in here ✨ Ignore specific paths Needs work

    Please use PR from this point

  • Pipeline finished with Success
    9 months ago
    Total: 154s
    #342026
  • 🇳🇱Netherlands batigolix Utrecht

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

  • Pipeline finished with Success
    9 months ago
    Total: 137s
    #354222
  • 🇳🇱Netherlands batigolix Utrecht
  • Status changed to Needs review 21 days ago
  • 🇫🇷France lazzyvn paris

    newest patch for dev branch

  • 🇳🇱Netherlands batigolix Utrecht

    @lazzyvn please se the merge request for any changes.

    Personally, I think the generic solution provided in this issue is better than the specific solution proposed in ✨ Add option to ignore admin paths Needs review

    I tested the MR and it works well.

Production build 0.71.5 2024