I would like a way to resolve conflicts. If I have path aliases foo and foo/bar, I would like to have a blacklist for subpathauto so that I can tell it not to resolve foo/bar. Alternatively, if I only want to use the module for user/name/contact, I would like to be able to do that.
For now, I have to put up with user/2/contact because I have a page (path alias) foo and another one (created by Views, but maybe that does not matter) foo/bar.
Update: Yes, it does matter that the alias is created by Views. If foo and foo/bar are aliases for node/1 and node/2, then there is no problem, but if foo/bar is a path set in Views, then the View is lost.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | subpath-auto-1252502-whitelist-and-blacklist-13.patch | 5.51 KB | stefan.r |
| #13 | interdiff.txt | 453 bytes | stefan.r |
| #10 | subpathauto-allow_on_specific_paths-1252502-10.patch | 1.61 KB | func0der |
| #3 | subpath-auto-1252502-whitelist-and-blacklist.patch | 5.64 KB | smoothify |
Issue fork subpathauto-1252502
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #1
BenK commentedSubscribing
Comment #2
Taxoman commentedComment #3
smoothify commentedHere is an implementation for blacklisting and whitelisting.
It allows you to specify a blacklist and a whitelist separately for inbound and outbound. The outbound I would expect to be most commonly used, the inbound is good to save a bit of performance on a large site but using it can create 404s on your site if you are overzealous with blacklisting.
The blacklist takes precedence over the whitelist, which means that a path that is listed in the blacklist will never be converted, whereas one in the whitelist will only be converted IF it doesn't appear in the blacklist.
So the order of precedence when at least one path is in the whitelist:
Blacklist - any paths matching here WILL NOT be converted.
Whitelist - any paths matching here but not in the blacklist WILL be converted
All other paths WILL NOT be converted.
If the whitelist is empty (default) the order of precedence becomes:
Blacklist - any paths matching here WILL NOT be converted.
Admin Paths - if ignore admin paths is checked, and the path is an admin path then it WILL NOT be converted.
All other paths WILL be converted.
Comment #4
xaqroxPatch in #3 seems to work but I didn't test it very thoroughly, just enough to get my work done. Probably needs more eyes.
Comment #5
orakili commentedTested the patch in #3 on a large site, it worked fine.
It would be nice to have it included into the module.
Setting as RTBC.
Comment #6
jordanmagnuson commentedThanks for the great patch, smoothify! Definitely adds a lot to the module!
Have tested it pretty thoroughly using both inbound and outbound filters, and it seems to be working, so plus one for getting it committed (though I have not done any performance benchmarks).
Can anyone tell me what the best way to benchmark performance gains from this patch would be?
Comment #7
chili.hh commentedPatch from #3 works as desired, but causes an infinite recursion on drush cc all on my system in conjunction with xmlsitemap.
Snippet from the backtrace:
Addition:
Before updating subpathauto from v7.x-1.1 to v7.x-1.3 and applying the patch there was no occurence of an infinite recursion. The only changes since happened to subpathauto.
Comment #8
chili.hh commentedJust noticed that the bug from #7 is already known, see https://drupal.org/node/1844150. So please just ignore my nonsense above for this issue :)
Comment #9
dshields commentedPatch in #3 is awesome!
i'm blacklisting:
*/edit
*/moderation
*/translate
which brings back standard urls for those operations while allowing me to set up something like node/%node/foo/bar to provide an alternative display for node/%node
Let's get this patch committed!
Comment #9.0
dshields commentedupdate after further experimentaiton
Comment #10
func0der commentedA pretty simple whitelist solution would be also the one attached.
I know blacklisting is missing, but it works pretty fine.
Comment #11
bdanin commentedThe patch in #10 is working great for me, just what I needed!
subpathauto was interfering with all my node-edit links
I am whitelisting quiz/* for my quiz/take sub-paths. This patch fixed the problem, thank you!
EDIT: actually path-auto + quiz (when clicking on a link) reverts the URL in to use the node/ID/take instead of the subpath; probably a conflict in the quiz-5.x module though
Comment #12
heddn+1 on RTBC
Comment #13
stefan.r commentedRe-roll of #3 (which was RTBC) attached
Comment #14
heddnTo clarify, I was RTBCing #3.
Comment #15
azinck commented#13 is RTBC for me.
Comment #16
jordanmagnuson commentedIt looks like this patch was never applied to the module. Anyone know if the 7.x version of this module still being maintained?
Comment #17
c.e.a commentedSuch a great and useful module...
But what about the Drupal 8 version of this module ??
I would like to ENABLE this module only for /user/... and /node/... pages, is that possible ??
Thank you,
Comment #18
volkswagenchickThis issue doesn't seem to have moved forward... but, there is an effort in the Drupal community to move away from using white/black list in favor of more inclusive language. Please see this core issue: https://www.drupal.org/project/drupal/issues/2993575
Thanks, moving this to needs work.