Closed (fixed)
Project:
Global Redirect
Version:
4.7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Oct 2006 at 01:23 UTC
Updated:
6 Mar 2007 at 12:08 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
RayZ commentedVery strange ... I've gone so far as to disable all other modules besides path, page, menu and globalredirect. I've cleared the cache, I've changed the default front page. My aliases work just fine, but nothing will get it to redirect.
I assume this actually does work for somebody, right?
Comment #2
nicholasthompsonIt certainly works for me...
Check this:
http://www.sportbusiness.com/node/160637
goes to:
http://www.sportbusiness.com/news/160637/two-united-directors-quit
just to confirm - you have mapped node/21 to about and when you go to node/21 (not node/21/ - no trailing slash) it doesn't redirect to the alias?
I cant imagine why this would happen. I'm using the 4.7.3 for our site - I'm not sure what you mean by CVS... CVS is currently Drupal 5.0 isn't it?
Comment #3
RayZ commentedjust to confirm - you have mapped node/21 to about and when you go to node/21 (not node/21/ - no trailing slash) it doesn't redirect to the alias?
Correct. No trailing slash. No redirect.
I am running on a current CVS checkout of the DRUPAL-4-7 branch. This is basically 4.7.3, plus any bug fixes that have gone into that branch since the release. This makes it much easier to upgrade ... when 4.7.4 comes out all I have to do is type 'cvs up -dP' in my drupal directory and it's upgraded. No downloading, unzipping, copying files, etc.
I suppose it's *possible* that a change since 4.7.3 breaks your module, but that shouldn't happen on a stable branch.
So I am baffled. For what it's worth the path_redirect module *is* working, as are all other installed modules. I have clean URLs enabled, and I have my modules installed in sites/default/modules. I get the same behavior on my dev site running on Mac OS X and my production server running on Linux.
Any suggestions for helping to debug this?
Comment #4
nicholasthompsonWell well... This is a genuine head scratcher!
Ok... What happens if you disable path redirect? I haven't tried that module yet. Maybe its causing an issue?
Umm.. Try chucking an echo of something and then an exit() in the main function just to check its actually running.
Do you have Error reporting enabled and, if so, what level? Have you tried E_ALL to see if the module is throwing any errors?
Comment #5
RayZ commentedOK, I have
error_reporting = E_ALL & ~E_NOTICE. Turning off all other modules except menu, path, page, and globalredirect makes no difference. If I slip the following code intoglobalredirect_init()right after the call todrupal_lookup_path()...... and then access 'node/23' (which is aliased to 'about/cornell'), I get the following ...
If I access 'node/21' (which is aliased to 'about'), I get the following ...
So it looks like the alias lookup is failing for the current page? Hmmm.
Comment #6
RayZ commentedOK, looks like it is a bug in drupal core introduced since drupal 4.7.3 was released. It was introduced by this patch http://drupal.org/node/83234. Backing out this patch fixes the problem.
Comment #7
RayZ commentedI submitted an issue for core here http://drupal.org/node/89947.
Comment #8
nicholasthompsonNicely tracked down - So basically GlobalRedirect IS broken in 4.7.4?
Comment #9
RayZ commentedIt appears so to me ... but I'd love to have someone else confirm it.
Comment #10
ednique commentedI noticed too that the global redirect does not work on 4.7.4 anymore...
Comment #11
RayZ commentedFixed by this patch http://drupal.org/node/65493
Comment #12
Robardi56 commentedSo, is this global redirect module working or not ? It seems it works fine on the site of the author ?
Brakkar
Comment #13
RayZ commentedI believe the conclusion is that it works fine on drupal 4.7.3 (and probably earlier 4.7.x), but not on 4.7.4. Unfortunately, 4.7.4 introduced a bug that breaks the functionality of the globalredirect module. Applying the patch in #14 of http://drupal.org/node/65493 fixes the bug in 4.7.4 that broke this module.
Comment #14
nicholasthompsonThanks for all that RayZ - I've been so busy recently I haven't had a chance to test if this does indeed fix Global Redirect for 4.7.4 - but if it does, great work. Much appreciated...
Fyi, here is a link directly to post #14.
Comment #15
nicholasthompsonI can confirm that applying that patch does indeed solve the redirect issue (not being redirected to the alias when you visit the node directly). I have applied the patch to my live site and all seems to be working ok... I'll mark this as closed unless anyone can find any problems with the patch.
Comment #16
hass commentedplease check out http://cvs.drupal.org/viewcvs/*checkout*/drupal/drupal/includes/path.inc... this looks like the next version... and not patch #14! Asside i found another bug in the module caused by
drupal_goto($alias);...Comment #17
Anonymous (not verified) commentedHow is this checkout supposed to tag to DRUPAL-4.7? Nevermind I'll go ask on the development list but I think if I'm looking at the DRUPAL-4.7 branch viewcvs should tag the checkout. Just thought I'd mention it here for caution sake.
Comment #18
Anonymous (not verified) commented*MY BAD* - never mind the previous post.
Comment #19
hass commentedok, not "checking out" the file from CVS... only download it .-)
Comment #20
Christoph C. Cemper commentedhmm - I got it working with
path.inc - rev 1.4.2.4
globalredirect.module - rev HEAD
Comment #21
mattman commentedDoes anyone know what is going on with this module and 4.7.4? I'm using path.inc 1.4.2.5 and globalredirect 1.5 (HEAD - I think). The module is executing - because a path with a trailing "/" is stripped. However, the redirect to the actual alias is not working. I'm watching my access log using tail -f and there's no 301 to the proper alias.
Comment #22
mattman commentedNevermind!!! stupid me. One of those bonehead developer moves. You know, you alter the data while testing your code modifications and you forget to change it back - and you keep testing against the same bad data. This will make more sense. I was testing against a url alias I had modified to use a preceding slash "/node/200", where I should have changed it back to "node/200".
Of course, drupal won't find the alias to "node/200" when it doesn't exist.... Arggggg. Haven't we all done that? The real sucky part is the fact that you tear your hair out going around and around when it's your data that has the issue - not your code. And you're the one that caused the problem. :(
Comment #23
Anonymous (not verified) commentedJust wanted to point out that, after upgrading to 4.7.5, the redirect seems to be working again (I'm using the "unpatched" version).
Comment #24
ednique commentedYep, same for me... working again...
Comment #25
RayZ commentedFor me, it appears to work for all but the front page. I assume it is still due to http://drupal.org/node/65493, which has not yet been fixed.
In my case, the variable site_frontpage = 'frontpage' and 'node/312' is aliased to 'frontpage'. It will redirect 'http://example.com/node/312' to 'http://example.com/frontpage'. But it won't redirect 'http://example.com/frontpage' to 'http://example.com/'.
Comment #26
nicholasthompsonI confirm - 4.7.5 is much better for alias lookups!
Question - why would you alias a node to frontpage? Why not just set that node as the frontpage setting in admin>settings?
Comment #27
RayZ commentedAh ... hmmm ... I see your point. I guess I set up my site_frontpage in admin>settings before deciding how I was going to create the home page (a node, a view ...?).
However, that still doesn't change the fact that globalredirect does not work for the home page. When I change my site_frontpage to 'node/312' and get rid of the 'frontpage' alias, then access node/312, there is no redirect.
I think if http://drupal.org/node/65493 gets fixed that should take care of both scenarios, but I haven't been able to check the latest patch there.
Comment #28
(not verified) commentedComment #29
boreg commentedHi,
I'm not good at English, so maybe i overlook something, so feel free to correct me:
Isn't better to patch the globalredirect.module file than the core files?
I have Drupal 4.7.4 and this my "fast and inept" solution (also in the patch file) works for me: