Improve description of Excluded paths

Created on 2 August 2024, 8 months ago
Updated 24 August 2024, 8 months ago

Please open merge requests and not patches for code you want to include: https://www.gregboggs.com/drupal-merge-requests/

current:

Enter a line separated list of paths to be excluded while generating the segments. Paths may use simple regex, i.e.: report\/2[0-9][0-9][0-9].

better:

Enter a line separated list of paths to be excluded while generating the segments. Slashes must be escaped i.e.: ( foo/bar should be foo\/bar ) Paths may use simple regex, i.e.: report\/2[0-9][0-9][0-9].

๐Ÿ“Œ Task
Status

Fixed

Version

2.0

Component

Code

Created by

๐Ÿ‡ฉ๐Ÿ‡ชGermany spuky

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

Merge Requests

Comments & Activities

  • Issue created by @spuky
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia prem suthar Ahemdabad- Gujrat , Jodhpur - Rajsthan

    Prem Suthar โ†’ made their first commit to this issueโ€™s fork.

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany spuky
  • Pipeline finished with Success
    8 months ago
    Total: 132s
    #241785
  • Status changed to Needs review 8 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia prem suthar Ahemdabad- Gujrat , Jodhpur - Rajsthan

    Update the Description Based on the Suggestion
    Please review.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States joakland
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany spuky

    wow that was quick ;-) thanks for your work!

  • Pipeline finished with Skipped
    8 months ago
    #241793
  • Status changed to Fixed 8 months ago
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany spuky
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States joakland

    I think this solution puts too much of the onus on the user. In my experience, most of the folks making configuration changes via the UI are not familiar with escaping characters and do not know how to use regular expressions. For people who do understand regex, it's not clear what constitutes "simple" regex. The only way they would know if their regex is insufficiently simple is if the path exclusion doesn't work.

    There are other places in Drupal where a user may enter paths (such as the visibility section of block configurations) that address the same problem without relying on regular expressions, or requiring users to make a judgement about complexity. Adopting such an approach would be a more user-centered solution.

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany spuky

    on the one hand I understand your point... on the other hand it is an "Advanced" Setting...
    So reading the description of how to use it could be expected.. the added Text + an example of how to escape slashes was added.

    It was taking me several tries to come up with the Idea to not escape the string here to get the warning and stack trace

    This was an easy fix to Improve the usability for users by providing inline documentation.

    New feature requests or even merge request for Improvements like:

    - verification of entered stings on save with an error message (maybe best solution when thinking about updates of existing config..)
    - spliting the config in two fields one for regex one for simple paths
    - having an "regex!" prefix like the custom breadcrumb field

    are welcome

    but somebody has to write that code, make sure it does not break the stuff for people already having a regex in there...
    to provide a sane update... to whatever the situation is changed to...

    and till then a field that gives someone the power to do what they need with the risk of some "foot shooting" is better than a less powerfull alternative ;-)

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States joakland

    That all makes sense. And you make a good point that someone using the advanced settings is more likely to be able to write those strings correctly. The inline documentation you added does a good job of explaining how to do this.

    That said, I do think programmatically escaping slashes that are not already escaped is a low bar to clear. I'm going to do this in a different issue/push request, which you of course are free to accept, edit, or reject.

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

Production build 0.71.5 2024