Closed (fixed)
Project:
Smart IP
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Jan 2013 at 15:31 UTC
Updated:
19 Feb 2013 at 00:20 UTC
The current MaxMind integration didn't work for me, as the country code was converted to lower case, although Drupal uses upper case.
Furthermore the patch contains a simple static cache in smart_ip_get_location() for multiple calls with the same ip address on the same page. This happened to me on a commerce product page that has two currency fields.
Sorry for mixing two things in one patch, but dividing it was difficult due to many whitespace fixes.
| Comment | File | Size | Author |
|---|---|---|---|
| smart_ip_fixes.patch | 12.24 KB | mh86 |
Comments
Comment #1
arpeggio commentedHi mh86, I have applied your patch (static cache part only) to both D6 and D7 version. That static cache is very good idea. About the country code converting to lower case, we would like to have consistency as we notice that all other data source are converted to lower case. Instead, I suggest to use the hook_smart_ip_get_location_alter() to alter the country code to any case your application needs. Thank you for sharing your patch.
Comment #2
mh86 commentedHi arpeggio,
thanks for committing the static cache part :-)
Concerning the country code, the ipinfodb service (which I used before) returns it in upper case, so I though it's more consistent this way. Furthermore the rules action won't work with lower case.
Comment #3
arpeggio commentedHi mh86, I have implemented the convert to lower case. Yes you are right, other data source are in upper case. Thank you for pointing that out. Please use the dev version.