ip2locale wouldn't for me. I tried both ip2country and ip2cc backends, with no luck. I also tried disabling, uninstalling and reinstalling both the stable and the dev versions. Nothing does it.
The only results I've got so far is these errors in the log:
[Sat Mar 13 23:55:07 2010] [error] [client 72.30.161.253] PHP Notice: Undefined variable: redirect in /var/www/vhosts/somesite.com/httpdocs/sites/all/modules/ip2locale/ip2locale.module on line 241
[Sun Mar 14 00:08:57 2010] [error] [client 67.195.37.156] PHP Notice: Undefined index: ip2locale_lc in /var/www/vhosts/somesite.com/httpdocs/sites/all/modules/ip2locale/ip2locale.module on line 176
[Sun Mar 14 00:08:57 2010] [error] [client 67.195.37.156] PHP Notice: Undefined index: q in /var/www/vhosts/somesite.com/httpdocs/sites/all/modules/ip2locale/ip2locale.module on line 209
[Sun Mar 14 00:08:57 2010] [error] [client 67.195.37.156] PHP Notice: Undefined variable: redirect in /var/www/vhosts/somesite.com/httpdocs/sites/all/modules/ip2locale/ip2locale.module on line 241
[Sun Mar 14 00:08:57 2010] [error] [client 67.195.37.156] PHP Notice: Undefined variable: redirect in /var/www/vhosts/somesite.com/httpdocs/sites/all/modules/ip2locale/ip2locale.module on line 241
[Sun Mar 14 00:08:57 2010] [error] [client 67.195.37.156] PHP Notice: Undefined variable: redirect in /var/www/vhosts/somesite.com/httpdocs/sites/all/modules/ip2locale/ip2locale.module on line 241
[Sun Mar 14 00:09:07 2010] [error] [client 67.195.37.156] PHP Notice: Undefined index: ip2locale_lc in /var/www/vhosts/somesite.com/httpdocs/sites/all/modules/ip2locale/ip2locale.module on line 176
[Sun Mar 14 00:09:07 2010] [error] [client 67.195.37.156] PHP Notice: Undefined variable: redirect in /var/www/vhosts/somesite.com/httpdocs/sites/all/modules/ip2locale/ip2locale.module on line 241
[Sun Mar 14 00:09:07 2010] [error] [client 67.195.37.156] PHP Notice: Undefined variable: redirect in /var/www/vhosts/somesite.com/httpdocs/sites/all/modules/ip2locale/ip2locale.module on line 241
[Sun Mar 14 00:09:07 2010] [error] [client 67.195.37.156] PHP Notice: Undefined variable: redirect in /var/www/vhosts/somesite.com/httpdocs/sites/all/modules/ip2locale/ip2locale.module on line 241
Please help.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | php_warnings_and_notices-741778.patch | 1.63 KB | jonathanpglick |
Comments
Comment #1
Gabriel R. commentedThe one Backend I didn't try yet is the GeoIP API module. Is it worth trying it out?
Comment #2
Gabriel R. commentedComment #4
Gabriel R. commentedThe errors disappeared from the web pages, but it still lurks under the hood.
It actually breaks Drush for me. Here is what 'drush -d cron' reports:
If the ip2locale module is disabled, Drush works again.
Comment #5
Gabriel R. commentedDisabling and re-enabling the module does not fix the issue.
Comment #6
Gabriel R. commentedOK, so I just realized that this has nothing to do with the DB: index here is not about a table but just some innocent PHP notice about an array index.
I am not even sure if this is the precise issue that breaks Drush, but it's pretty obvious that ip2locale is the culprit.
Any help would be appreciated.
Comment #7
Gabriel R. commentedOK, I figured it out. The same way you check if the current page is cron or update, you much check that you are not running from CLI.
To fix this, check for
$_SERVER['SERVER_ADDR']. Add the check at the beginning of ip2locale_boot() like so:Comment #8
mrfelton commented#741778 by Gabriel Radic: Fixed Undefined variable: redirect; Undefined index: ip2locale_lc();.
Thanks.
Comment #10
jonathanpglick commentedNot sure if anyone is still having problems with this but I created a patch that resolves a few of the PHP warnings and notices that was keeping this module from working for me.
Fixes:
- $_REQUEST['q'] won't be set on homepage
- $redirect can be undefined
- undefined index error with $custom_mappings[$cc]
- undefined index error with isset($_GET['ip2locale_debug'])