I was trying to use smart ip to load latitude and longitude for proximity filter on view but It was returning nothing.

I found that $_SESSION did not hold the latitude and longitude for the persons ip like it was supposed to (not exactly sure why)

I fixed it by using smart_ip_session_get('smart_ip');

Proposed resolution

file: location.views.inc
line 585

if (module_exists('smart_ip')) {
  $smart_ip_session = smart_ip_session_get('smart_ip');
  if (isset($smart_ip_session['location']['latitude']) &&
    isset($smart_ip_session['location']['longitude'])) {
    $coordinates['latitude'] = (float) $smart_ip_session['location']['latitude'];
    $coordinates['longitude'] = (float) $smart_ip_session['location']['longitude'];
#2 2011196-smart-ip-2.patch4.61 KBpodarok
PASSED: [[SimpleTest]]: [MySQL] 425 pass(es). View


pribeh’s picture

@UziTech, thanks for this code. It helped me resolve the same issue using views 3.3. I'm not positive but I think this isn't working with views 3.7. What version are you using?

podarok’s picture

Version: 7.x-3.0-rc1 » 7.x-3.x-dev
Status: Patch (to be ported) » Needs review
4.61 KB
PASSED: [[SimpleTest]]: [MySQL] 425 pass(es). View

here is a patch for this

podarok’s picture

Status: Needs review » Fixed

#2 commited pushed to 7.x-3.x

Status: Fixed » Closed (fixed)

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