Thanks for a great module, unfortunately I can't use it on my site because I am using the Subdomain module. Subdomain lets you extend path aliases to subdomains, and it does it using a neat trick: if you enter an alias like this: ~blog/entry, the path gets rewritten to look like this: http://blog.mysite.com/entry. So the tilde character has the special property of setting the subdomain for a path.
Anyway, when I enabled this module I discovered that sub-path aliases don't respect the special properties of the tilde, so clicking on the edit tab in the above example would take you to http://mysite.com/~blog/entry/edit instead of http://blog.mysite.com/entry/edit.
Any chance this could be fixed?
Thanks!
Comment | File | Size | Author |
---|---|---|---|
#4 | subpath_alias-subdomain-compatibility.patch | 1.75 KB | John Morahan |
#3 | subpath_alias-subdomain-compatibility.patch | 1.3 KB | John Morahan |
Comments
Comment #1
John Morahan CreditAttribution: John Morahan commentedIf you decrease the weight of subpath_alias so that it runs before subdomain, that works for outbound URLs.
It doesn't work for inbound URLs because of this code in subpath_alias_url_inbound_alter():
Commenting out that code seems to work. But I'm not sure what the consequences of removing this case might be (guessing a performance hit, from the comment).
Comment #2
smk-ka CreditAttribution: smk-ka commentedGood catch, thank you!
That's right, it's purely performance related and can be nuked if we gain better compatibility. Could you create a patch based on the findings?
Comment #3
John Morahan CreditAttribution: John Morahan commentedHmm.
Well, here's the patch. But on further investigation it doesn't totally clear things up. Outbound paths are not rewritten correctly on a subdomain front page, and I don't know why.
Comment #4
John Morahan CreditAttribution: John Morahan commentedIn subpath_alias_url_outbound_alter():
If you remove the 'if' and unconditionally add the subpath to $args, it works.
But why does it think it 'knows' there is no mapping in this case?
Patch attached, in case you think it makes sense...
Comment #5
colemanw CreditAttribution: colemanw commented@smk-ka & John Morahan
I think you can keep the performance gain and just opt-out subdomain users, like so: