Got the following notices after updating to the latest dev version:
# Notice: Undefined index: q in globalredirect_init() (line 208 of [path]\sites\all\modules\globalredirect\globalredirect.module).
# Notice: Undefined index: q in globalredirect_init() (line 210 of [path]\sites\all\modules\globalredirect\globalredirect.module).
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | globalredirect-d7.0.alpha6-apache2.2-php5.2.png | 29.44 KB | nicholasthompson |
Comments
Comment #1
nicholasthompsonThanks - I'll take a look into this.
http://drupalcode.org/viewvc/drupal/contributions/modules/globalredirect...
Looks like this would probably only ever happen on the frontpage, when there is no "q"...?
Comment #2
adrian drupal commentedMy first time in Drupal, I'm trying to bring my blog from Squarespace, Drupal 7 all is working well until today trying to install Global Redirect, this message appears.
Notice: Undefined index: q in globalredirect_init() (line 208 of /home/xxxxxx/xxxxxx_html/sites/all/modules/globalredirect/globalredirect.module
I have no idea how to solve this, anyone know if it resolved soon, I think this module is required to bring my content.
Thank you.
Comment #3
tsvenson commentedIts much worse than that. You can't open any /admin pages, wither direct or in overlay. After some time the browser shows an error saying that it it can't open a page due to that the redirect will never be resolved.
I tried to manually disable the module by changing status from 1 to 0 in the system table, but I still got the above errors. Only way I could get into admin again was after I commented out the if's in the module.
Comment #4
nicholasthompson@tsvenson: That's interesting. I'll have to take a look at that. You using 7.0-ALPHA6?
Comment #5
tsvenson commentedYes, I'm on Alpha 6. Ping me if/when you need help testing.
Comment #6
nicholasthompsonInterestingly, I cannot replicate this on my Lighttpd devbox...
Comment #7
dave reidDo you have E_NOTICE errors enabled in error_reporting?
Comment #8
nicholasthompsonIt's not an error reporting issue...
If I add:
above line 208, my Lighttpd devbox (Lighttpd 1.4.26 and PHP 5.3) shows that $_REQUST['q'] exists and mimcks the "alias" (or raw) path, wheras $_GET['q'] is the source.
On my other devbox, running Apache 2.2 and PHP 5.2, $_REQUEST contains an entirely different set of values...
I am still investigating as to why this is happening...
NOTE: You must
return;just after doing thedpm()otherwise you'll never see it ;)Comment #9
nicholasthompsonDrupal 7 handles Clean URL's differently.
In Drupal 6, the RewriteRule pushes the request uri into index.php?q=$1. This is why $_GET['q'] and $_REQUEST['q'] are both set.
In Drupal 7, the RewriteRule simply sets all URL's to go to index.php. drupal_environment_initialize then handles the URL via request_path.
This difference in behaviour means there is no $_REQUEST['q'].
Comment #10
nicholasthompsonIn addition, my Lighttpd box only works because my Lua Script for Clean URL's mimicks Drupal 6's htaccess. I guess it's a miracle Drupal 7 works on my devbox at all! ;-)
Comment #11
tsvenson commentedMy local dev environment is Wampserver 2.0h (since 2.0i comes with PHP5.3) on a Windows XP box.
The modules I am have enabled on it is:
Drupal 7.0-alpha6
AddThis Button 7.x-2.x-dev (2010-Jul-11)
Advanced help 7.x-1.x-dev (2010-Jul-15)
Backup and Migrate 7.x-2.x-dev (2010-Jul-11)
Comment Notify 7.x-1.x-dev (2010-Jul-11)
Comment subjects 7.x-2.x-dev (2010-Jul-11)
External Links 7.x-1.11
Flexible Blogs 7.x-1.x-dev (2010-Jul-11)
Follow 7.x-1.x-dev (2010-Jul-11)
Google Analytics 7.x-1.x-dev (2010-Jul-11)
Image Resize Filter 7.x-1.x-dev (2010-Jul-11)
Insert 7.x-1.0-alpha1
Mollom 7.x-1.0-alpha2
Path redirect 7.x-1.x-dev (2010-Jul-11)
Pathauto 7.x-1.x-dev (2010-Jul-11)
Site verification 7.x-1.x-dev (2010-Jul-11)
Token 7.x-1.x-dev (2010-Jul-11)
Views 7.x-3.x-dev (2010-Jul-15)
Wysiwyg 7.x-2.x-dev (2010-Jul-11)
XML sitemap 7.x-2.x-dev (2010-Jul-11)
As you can see i use both Pathauto and Path redirect. Maybe this is some kind of incompatibility between them and Global redirect?
I did install everything fresh on D7 alpha 6.
One other thing is that I did test Global redirect on D7 alpha 5 a few weeks back and it didn't trigger any errors. Maybe they changed something between those two alphas that causes this problem.
Hope this might help so you can recreate this.
Comment #12
nicholasthompsonThanks for that Thomas.
The issue is nothing to do with any other module - it is simple a failure to comply with a complete change in how URL's are handles in Drupal 7. My fault :-)
Comment #13
nicholasthompsonWell that didn't go well - first test run after "fixing" it... 56 passes, 54 fails and 2 exceptions!
EDIT: Of course... it would help if I gave the test bot the devbox password ;-)
Comment #14
tsvenson commentedAha. Well as you saw in my edit, I didn't get any errors when I tried your module in alpha 5.
Glad we could sort it out. Let me know when you need help testing any fix and I will gladly help out.
Comment #15
nicholasthompsonI've committed several major fixes to the Drupal 7 branch - care to test?
Comment #16
tsvenson commentedYepp, testing now.
Updated fine and no more error messages on screen or in log.
I also tested redirection of non clean URL and these are my results:
Settings used/turned on:
Deslash - On
Non-clean to Clean - On
Remove Trailing Zero Argument - Enabled for all pages
Case Sensitive URL Checking - On
Taxonomy Term Path Handler - On
example.com/node/1 -> example.com/node/1
example.com?q=node/1 -> example.com/?q=node/1
Only diff is the / added in the second URL.
I also tested with Add Canonical Link turned on, but with the same results.
Also tested both as anonymous and authenticated user with same results.
Tested in both Firefox 3.6.6 and Chrome with same results.
Canonical is getting blue (Firefox) and pointing to clean URL. However it does so with the Add Canonical Link both on and off so I guess that comes from core or the Pathauto module.
No warnings or errors shown/logged during test.
Not sure what else I can test to try and figure out what's going on here.
Comment #17
eule commentedhi
this bug is presented in the 7.13 tested on a drupal alpha 6
# Notice: Undefined index: q in globalredirect_init() (line 208 of ./modules/globalredirect/globalredirect.module).
# Notice: Undefined index: q in globalredirect_init() (line 210 of ./modules/globalredirect/globalredirect.module).
drupal crashs total and i cant join any site.
del and install the new dev works fine
thanks for the work
Comment #18
lpalgarvio commentedgetting the same notices.
site becomes unnavigatable after enabling the module.
Global Redirect 1.3-alpha1
Drupal 7 alpha6
then if i replace the 7-x-1.3-alpha1 version with the 7-x-1.x-dev, it starts working again and i get no more notices
Global Redirect 1.x-dev
July 17, 2010 - 01:07
Drupal 7 alpha6
looks like its fixed
Comment #19
dave reidMarked the following issue as duplicates of this issue:
#905808: Unable to access administration after activation
#938126: unable to access site after module enabling
#886070: endless redirect loop on most pages
Comment #20
thekevinday commentedI am also having this problem and a workaround the error message is changing
to
for the file:
globalredirect/globalredirect.moduleat line 208.For some reason q is not defined in _REQUEST, this may be related to how the dashboard javascript is handling the url changes.
#9 seems to explain this.
So the question is, is it correct to use a isset() here as a solution or is the bug elsewere?
Comment #21
caschbre commentedJust to confirm I had the same scenario / solution as #18 above.
Comment #22
jzornig commentedI'm also getting this on d7-rc2. If I enable clean URLs and install Global Redirect the site becomes unusable.
Comment #23
nihonsei commentedI'm also getting this on d7-rc3.
Comment #24
CmKeen commentedSame thing on d7-rc4
Comment #25
jamesoakleysubscribe
Comment #26
krato commentedI'm also getting this on Drupal 7 final version. Please, fix it, it blocks me from using Drupal 7.
Comment #27
jamesoakleyMarking this as Active (instead of "Needs Review"), as the patches committed at #15 were a long time ago and it appears people are still finding this issue even with those changes.
Comment #28
jamesoakleyActually, my previous post (#27) was wrong. The fixes committed at #15 did repair the problem - I've just tested against the 7.x-1.x-dev, and the problem is gone. (My mistake for assuming that an alpha from last July could not have been the most recent release).
Now that D7 is live, please could we have a formal release (beta if necessary) for this module, so that people downloading D7 don't install the 7.x-1.3-Alpha1 version of this module by mistake and lose access to their site as a result?
Comment #29
nicholasthompsonIm just confirming the simpletest runs and I'll push out a 1.3 release so it's inline with 6.x.
Comment #30
nicholasthompsonI have pushed out a 1.3 release which is based on the dev branch as of today.
http://drupal.org/node/1015896
Comment #31
jamesoakley:-)