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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

eabrand’s picture

Version: 5.x-2.0 » 6.x-2.x-dev
Assigned: Unassigned » eabrand
Priority: Minor » Normal
Status: Active » Needs review
FileSize
2.2 KB

Here's a patch for this problem.

Crell’s picture

Status: Needs review » Needs work

Function 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...

eabrand’s picture

Status: Needs work » Needs review

That was the problem the person who opened the ticket was having, so does that mean this ticket should be closed?

eabrand’s picture

Version: 6.x-2.x-dev » 6.x-2.1
FileSize
2.07 KB

Here is a patch to help the users that may have $_GET['q'] unset for some reason.

eabrand’s picture

FileSize
2.12 KB

Here 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();
}

Crell’s picture

Status: Needs review » Needs work

The 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".

eabrand’s picture

Status: Needs work » Needs review
FileSize
2.23 KB

Here's an updated comment

Crell’s picture

Status: Needs review » Fixed

Committed. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.