Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Sub-pathauto is here!!
This is a simplification and rewrite of the Subpath URL alias module for Drupal 7 that "just works."
Note: please ignore the attached file. It was attached here along with the initial issue description and there is no way to remove it :/
Comment | File | Size | Author |
---|---|---|---|
#28 | rightmostsegment.patch | 3.34 KB | vdsh |
#7 | subpathauto.zip | 3.07 KB | Dave Reid |
#2 | subpath_alias_7.x.zip | 4.59 KB | jcarlson34 |
upgrade-subpath_alias-to-D7.patch | 6.06 KB | sven.lauer |
Comments
Comment #1
jcarlson34 CreditAttribution: jcarlson34 commentedHi sven. Thanks for working on this.
I would love to test the port and the patch but patching the CVS HEAD leads to hunk fails for me on both mac and pcs. Probably something wrong on my end.
@Maintainers... Any chance we could get a 7.x dev version started based off sven's patch? Many thanks.
Comment #2
jcarlson34 CreditAttribution: jcarlson34 commentedOk so I've ended up building the patch by hand, checking twice to make sure I copied everything correctly (ugh).
So far it seems to be working great.
I've attached the updated 7.x module in a zipped file in case anyone else has patching issues and wants to test it.
Comment #3
sven.lauer CreditAttribution: sven.lauer commented@jcarlson34: Not sure what the problem is. I just did a fresh CVS checkout and the patch applied cleanly ...
I'd really like to see a 7.x-dev version, as well ...
Comment #4
jcarlson34 CreditAttribution: jcarlson34 commentedYeah its all good. Most likely I'm doing something wrong. But the updated code is still working great so kudos Sven.
Looking forward to other people testing it and seeing if we can move this towards a dev version as well.
Comment #5
Niklas Fiekas CreditAttribution: Niklas Fiekas commentedSubscribe.
Comment #6
chriz001 CreditAttribution: chriz001 commentedsubscribe
Comment #7
Dave ReidHere's the code I've been working on for d7, lovingly called 'subpathauto'.
Comment #8
jcarlson34 CreditAttribution: jcarlson34 commentedDave Reid. You're awesome. Installed it and it works great.
Even works in situations like navigating from Views to Revisions to Edit, which was not yet working in the previous patch (would just show node/1/edit in the browser).
Love the module name 'subpathauto'. My only recommendation would be to change the name in the info file from "Sub-pathauto" to "Sub-Pathauto". Sounds tougher with the extra capitalization but that's just me :)
Comment #9
jcarlson34 CreditAttribution: jcarlson34 commentedNo problems found still. Marking this as RTBC.
I'm a little surprised this little module is not shipped with pathauto itself, either as a submodule or as an optional checkbox in the settings page. I'm sure there are some reasons for this but it'd be sweet to have it packaged with pathauto automatically.
Comment #10
jdleonardWorks well for me too, thanks!
Comment #11
jdleonardActually, seems like there's a problem. For "node/add" -> "create", "/create/blah" results in the page for "create". Shouldn't it return page not found (I don't have a content type "blah")?
Comment #12
Dave Reid@jdleonard: What happens when you hit the /create/blah page? If you see the same thing as the /create page then it's working by design. When I load /node/add/blah on my local install (without subpathauto enabled) I get the same screen as /node/add.
Comment #13
jdleonardOh, bizarre! Right you are. Any idea how to prevent this? Not ideal for SEO.
Comment #14
jdleonardI can't repro this on a clean d7 install so it must be related to another module, but when I go to "user/1/contact", the contact tab's URL is "/user/1/contact/ser/1/contact". "/ser/1/contact" gets added to the end another time when following the link. I don't see this anywhere else.
Comment #15
AgaPe CreditAttribution: AgaPe commentedGreat, that's what i need!
Comment #16
AgaPe CreditAttribution: AgaPe commentedI dont know if its other module conflict or that i don't have mod rewrite enabled? but it just breaks my urls.
/?q=node/5/stream/1 goes to /?q=node etc, just the first argument is seen... I tried both #2 and #7.
Comment #17
BenK CreditAttribution: BenK commentedSubscribing
Comment #18
tsvenson CreditAttribution: tsvenson commentedFollow
Comment #19
dopedwizard CreditAttribution: dopedwizard commentedsubscribing.
Comment #20
vdsh CreditAttribution: vdsh commentedFor #16, I got the same problem than you, there was a problem in subpathauto_lookup_subpath, in subpathauto.module (module subpathauto)
This is what you need to change (start from line 102, until the end of the function):
For me, this code works greatly !
The problem on the previous code was that the alias was looked starting from the left most segment, and we want it to start from the right most one.
Can you confirm that it works as well for you ?
Sorry if I haven't made a proper patch or stuff like that, but it is my first post on the website, please tell me if I should change something.
Comment #21
jeffwidman CreditAttribution: jeffwidman commentedsubscribe
Comment #22
jm.federico CreditAttribution: jm.federico commentedsubscribe
Comment #23
jm.federico CreditAttribution: jm.federico commentedI just want to point you all to http://drupal.org/sandbox/davereid/1078890 where there is a sandbox of #7
Comment #24
jcarlson34 CreditAttribution: jcarlson34 commented@jm.federico thanks for the link!
Comment #25
veikko CreditAttribution: veikko commentedsubscribe
Comment #26
Shadlington CreditAttribution: Shadlington commentedSubbing
Comment #27
rwohlebsubscribe
Comment #28
vdsh CreditAttribution: vdsh commentedI have created a topic on the sandbox with a patch for "complex" URL:
http://drupal.org/node/1151226
Comment #29
mrtoner CreditAttribution: mrtoner commentedNo obvious problems with #7 for me. I do want to note that I get kicked out of the overlay for node/edit, though.
Comment #30
MyXelf CreditAttribution: MyXelf commentedSubscribing...
Comment #31
JGO CreditAttribution: JGO commentedSubscribing
Comment #32
Romaq CreditAttribution: Romaq commentedSubscribe, I was about to report the fact sub-pathing DIDN'T work as a bug in pathauto, good thing I looked a little further. :)
Comment #33
fangel CreditAttribution: fangel commentedSubscribe
Comment #34
KD Eric Depta CreditAttribution: KD Eric Depta commentedGood work Dave.
I hope u can publish this subpathauto soon.
The git clone helped me alot allready =)
Comment #35
yareckon CreditAttribution: yareckon commentedsub
Comment #36
RobKoberg CreditAttribution: RobKoberg commentedsubscribe
Comment #37
brycesenz CreditAttribution: brycesenz commentedsubscribe
Comment #38
francois o CreditAttribution: francois o commentedsubscribe
Comment #39
klonos...subscribing.
Less vague issue title, adding proper tags and I am about to update the issue's summary to point people to http://drupal.org/sandbox/davereid/1078890 and #1240464: Initial release of Subpathauto? (D7) / Current status / What needs testing ...a.k.a. "Are we there yet?".
Comment #40
klonosPS: ...it would also be nice if this info (either a link to this issue here or over at subpathauto) was available to the project's page.
Comment #41
entrigan CreditAttribution: entrigan commentedHi everyone, wanted to throw out that a subset functionality can be accomplished fairly easily using hook_url_(in/out)bound_alter. If you need a complete solution, this module is probably the way to go. However if you just have a few paths that need correcting (like node/%node/*) then you can use something like the following:
Disclaimer: I just wrote this code and have not considered the performance or edge cases. I think it may only work for aliases what are of the form *part1*/*part2*
Comment #42
Dave ReidSubpathauto 7.x-1.0 has been tagged and released. Available on http://drupal.org/project/subpathauto as soon as the packaging script finishes.
Comment #43
klonosThanx Dave!
Comment #43.0
klonos...letting people know of the upcoming Subpathauto module and Extended path aliases as well.
Comment #43.1
klonos...point to Sub-pathauto.
Comment #44
bmango CreditAttribution: bmango commentedsubscribe
Comment #46
klonos...actually, since this will never happen here it is more of a won't-fix. Issue summary is already updated to point to subpathauto, so we're good.
Comment #46.0
klonos...note to ignore attached file.