From d41360ba4725dcd4c47662cf3849c33953b62ae5 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Wed, 11 Aug 2010 16:25:49 +0200 Subject: [PATCH] Only set geolocation if it has been submitted. --- kronolith/lib/Event.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/kronolith/lib/Event.php b/kronolith/lib/Event.php index a9a2c536b..cd446e70d 100644 --- a/kronolith/lib/Event.php +++ b/kronolith/lib/Event.php @@ -2380,9 +2380,12 @@ abstract class Kronolith_Event $this->_tags = Horde_Util::getFormData('tags', $this->tags); // Geolocation - $this->setGeoLocation(array('lat' => Horde_Util::getFormData('lat'), - 'lon' => Horde_Util::getFormData('lon'), - 'zoom' => Horde_Util::getFormData('zoom'))); + if (Horde_Util::getFormData('lat') && Horde_Util::getFormData('lon')) { + $this->setGeoLocation(array('lat' => Horde_Util::getFormData('lat'), + 'lon' => Horde_Util::getFormData('lon'), + 'zoom' => Horde_Util::getFormData('zoom'))); + } + $this->initialized = true; } @@ -2846,7 +2849,8 @@ abstract class Kronolith_Event public function getGeolocation() { /* Get geolocation data */ - if (($gDriver = Kronolith::getGeoDriver()) && !isset($this->_geoLocation)) { + if (!isset($this->_geoLocation) && + ($gDriver = Kronolith::getGeoDriver())) { try { $this->_geoLocation = $gDriver->getLocation($this->id); } catch (Exception $e) {} -- 2.11.0