Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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 CreditAttribution: eabrand commentedHere's a patch for this problem.
Comment #2
Crell CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: eabrand commentedHere is a patch to help the users that may have $_GET['q'] unset for some reason.
Comment #5
eabrand CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: eabrand commentedHere's an updated comment
Comment #8
Crell CreditAttribution: Crell commentedCommitted. Thanks!