Closed (fixed)
Project:
CacheExclude
Version:
6.x-2.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
4 Mar 2009 at 20:42 UTC
Updated:
10 Jun 2009 at 18:40 UTC
Jump to comment: Most recent file
Seems a slight patch is needed getting undefined Index notice on the $_GET['q'] when no query is in the URL. Which happens to be our whole site.
PHP Notice: Undefined index: q in /mnt/bravotv/sites/all/modules/cacheexclude/cacheexclude.module on line 40
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | cacheexclude_get.patch | 2.23 KB | eabrand |
| #5 | cacheexclude_get.patch | 2.12 KB | eabrand |
| #4 | cacheexclude_get.patch | 2.07 KB | eabrand |
| #1 | cacheexclude_get.patch | 2.2 KB | eabrand |
Comments
Comment #1
eabrand commentedHere's a patch for this problem.
Comment #2
Crell commentedFunction names in Drupal should always be all_lowercase() and use complete words. There's some whitespace issues in the new function, too.
How does core handle this? $_GET['q'] is set by system_boot(), isn't it? It should always have a value...
Comment #3
eabrand commentedThat was the problem the person who opened the ticket was having, so does that mean this ticket should be closed?
Comment #4
eabrand commentedHere is a patch to help the users that may have $_GET['q'] unset for some reason.
Comment #5
eabrand commentedHere is an update to the patch with an extra comment to explain the reasoning behind adding the following to the code:
if (!$_GET['q']) {
drupal_init_path();
}
Comment #6
Crell commentedThe comment still explains what we're doing, but not why we're doing it. Some users have reported an error, but it doesn't say what. The comment should be descriptive enough that someone who has not seen this thread can see that code, go "why are we doing this?", see the comment, and go "oh, that's why".
Comment #7
eabrand commentedHere's an updated comment
Comment #8
Crell commentedCommitted. Thanks!