From 725b2d0475ba3d0dcfafd48a191b4ddee09cae68 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 22 Dec 2009 21:58:23 -0800 Subject: [PATCH] save location at notice post time --- actions/newnotice.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/actions/newnotice.php b/actions/newnotice.php index c6c70e3260..c014f1781c 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -169,6 +169,14 @@ class NewnoticeAction extends Action $location_id = $this->trimmed('location_id'); $location_ns = $this->trimmed('location_ns'); + if (!empty($lat) && !empty($lon) && empty($location_id)) { + $location = Location::fromLatLon($lat, $lon); + if (!empty($location)) { + $location_id = $location->location_id; + $location_ns = $location->location_ns; + } + } + $upload = null; $upload = MediaFile::fromUpload('attach'); -- 2.39.2