Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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'];
}
}
Comment | File | Size | Author |
---|---|---|---|
#2 | 2011196-smart-ip-2.patch | 4.61 KB | podarok |
Comments
Comment #1
pribeh CreditAttribution: pribeh commented@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?
Comment #2
podarokhere is a patch for this
Comment #3
podarok#2 commited pushed to 7.x-3.x
thanks!