The path_alias_xt module dynamically expands aliases such as 'project/myproject' for 'node/7' to also include aliases such as 'project/myproject/edit' for 'node/7/edit'. This causes a redirect loop with globalredirect, because the later module is overzealous in its redirection in some instances.
Without path_alias_xt, globalredirect will take a request for 'node/7/edit' and attempt to redirect again to 'node/7/edit'. Because the new path is the same as the old path, this behavior is innocuous. As soon as path_alias_xt is involved, though, the behavior becomes undesirable, because the request is now actually for 'project/myproject/edit'. Now, when globalredirect tries to go to 'node/7/edit', the paths are different, and to 'goto' will take effect. Unfortunately, the next time around, globalredirect will try to do the same exact thing again. This is because, although the current path did change to 'node/7/edit', the request is still for 'project/myproject/edit', so globalredirect will once again try to go to 'node/7/edit', even though that is already the current path.
The solution is to make the conditional around the redirection more rigorous, so that globalredirect will not attempt to redirect from the current path to the same current path. This additional condition does not interfere with the primary operation of globalredirect -- i.e., to redirect from 'node/7' to 'project/myproject' -- because in this case the current path does not match with the desired redirect destination.
Patches for Drupal 7 and Drupal 6 versions of globalredirect attached.
Comment | File | Size | Author |
---|---|---|---|
globalredirect-6.x-with-path_alias_xt.patch | 676 bytes | greg.1.anderson | |
globalredirect-7.x-with-path_alias_xt.patch | 671 bytes | greg.1.anderson | |
Comments
Comment #1
greg.1.anderson CreditAttribution: greg.1.anderson commentedFor what it is worth, subpath_alias works fine with globalredirect even without the above patches.
Comment #3
greg.1.anderson CreditAttribution: greg.1.anderson commentedIs there any interest in this issue? Please comment or close.
Comment #4
R0land CreditAttribution: R0land commentedI also have this issue. In previous 7.x-1.x-dev version all was fine.
Comment #5
rjbrown99 CreditAttribution: rjbrown99 commentedI'm interested, and I use both modules, but I have not noticed this problem with path_alias_xt with Drupal 6.
Comment #6
wizonesolutionsThe patch should pass the tests first. I'm monitoring; can commit it when it does if it's otherwise OK.
Comment #7
greg.1.anderson CreditAttribution: greg.1.anderson commentedI checked my projects, and I have switched to using subpath_alias everywhere. Someone else will need to drive this to completion if path_alias_xt support is desired.
Comment #8
wizonesolutionsPostponing then. I use subpath_alias as well.
Comment #9
bluephx CreditAttribution: bluephx commentedglobalredirect-7.x-with-path_alias_xt.patch queued for re-testing.
Comment #10
TravisJohnston CreditAttribution: TravisJohnston commentedSubpath is not made for D7, so this is still an issue for us. The Extended Path Alias module works great by itself, and even after GR is enabled. But GR will only work when EPA is turned off.
Comment #11
greg.1.anderson CreditAttribution: greg.1.anderson commentedThe D7 version of subpath_alias is subpathauto.
Comment #12
carajito CreditAttribution: carajito commentedLast devel version of this module and the las version of sub-pathauto
When I try to go user/user-name/edit I will receive access deny
Comment #13
Chris Matthews CreditAttribution: Chris Matthews commentedGreg's 7 year old patch to globalredirect.module does not apply to the latest globalredirect 7.x-1.x-dev, but this issue should be closed as outdated anyway.