Hi Rik,
Thought you might like to know that sometimes, when no current location info is available, but the PHP from the module page is in an exposed filter for proximity from location the following comes up directly above the map:

    Notice: Undefined index: latitude in eval() (line 2 of /home/spot/public_html/sites/all/modules/location/location.views.inc(509) : eval()'d code).
    Notice: Undefined index: longitude in eval() (line 3 of /home/spot/public_html/sites/all/modules/location/location.views.inc(509) : eval()'d code).

Best,
Danny.

Comments

rdeboer’s picture

Thanks Danny,
Can you please copy the PHP you are using into this thread and I'll give you a more robust version that won't have the error msgs.
Rik

Funksmaname’s picture

Thanks, I copied it from your module page:

return array(
  'latitude'  => $_SESSION['ip_geoloc']['location']['latitude'],
  'longitude' => $_SESSION['ip_geoloc']['location']['longitude']
);
rdeboer’s picture

Try this...

if (isset($_SESSION['ip_geoloc']['location']['latitude'])) {
  return array(
    'latitude'  => $_SESSION['ip_geoloc']['location']['latitude'],
    'longitude' => $_SESSION['ip_geoloc']['location']['longitude']
  );
}
return array();

I'm not at my development environment at the moment, so can't test. This should get rid of the old notices, but may introduce a new one, as I'm not sure what the Location proximity field/filter does when you give it "empty".
Give it a go.

Rik

Funksmaname’s picture

Thanks again Rik, that seems to have done the trick. Will report back if anything funky happens.

btw, any reason why rectangular or circular proximity would be better than the other?

rdeboer’s picture

Assigned: Unassigned » rdeboer
Status: Active » Fixed

Re #4
Cool. I'll update the project page.

As for rectangular vs circular.... Good question for the Location module maintainer! But my suspicion is that it comes down to personal preference rather than one being "better" than the other.

Rik

Status: Fixed » Closed (fixed)

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