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.

CommentFileSizeAuthor
smart_ip_fixes.patch12.24 KBmh86

Comments

arpeggio’s picture

Status: Active » Fixed

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

mh86’s picture

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

arpeggio’s picture

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

Status: Fixed » Closed (fixed)

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