[datapress] r161 committed - Clear out old geocode cache when address changes. this prevents old co...

4 views
Skip to first unread message

codesite...@google.com

unread,
Mar 30, 2011, 3:27:50 PM3/30/11
to datapres...@googlegroups.com
Revision: 161
Author: edward.benson
Date: Wed Mar 30 12:27:20 2011
Log: Clear out old geocode cache when address changes. this prevents
old coords from being sent to client (would result in multiple map points
per item)
http://code.google.com/p/datapress/source/detail?r=161

Modified:
/trunk/plugin/configurator/exhibit-configurator.php
/trunk/plugin/wp-exhibit-geocoder.php

=======================================
--- /trunk/plugin/configurator/exhibit-configurator.php Wed Mar 30 12:10:58
2011
+++ /trunk/plugin/configurator/exhibit-configurator.php Wed Mar 30 12:27:20
2011
@@ -68,7 +68,6 @@
});
jQuery(document).ready(function(){
function postExhibit(e) {
- debugger;
var paste_exhibit = false;
var paste_footnotes = false;

=======================================
--- /trunk/plugin/wp-exhibit-geocoder.php Wed Mar 30 12:05:17 2011
+++ /trunk/plugin/wp-exhibit-geocoder.php Wed Mar 30 12:27:20 2011
@@ -40,6 +40,12 @@
}
else {
try {
+ // Delete any old address for <ExhibitID, AddressField, DatumID, *>
+ $deleteSQL = "DELETE FROM $table WHERE exhibit_id = %d AND
addressField = %s AND datum_id = %s;";
+ echo $deleteSQL;
+ $deleteQuery = $wpdb->prepare($deleteSQL, $exhibit_id,
$address_field, $datum_id);
+ $wpdb->query($deleteQuery);
+
$geo_results = json_decode(WpExhibitGeocoder::geocode($address), true);
$latlng = $geo_results['results'][0]['geometry']['location'];
if($latlng['lat'] == 0 && $latlng['lng'] == 0)

Reply all
Reply to author
Forward
0 new messages