Fixes email notification when user chose the non-geocoded address.
authorStéphane Jacob <sj@m4x.org>
Sat, 12 Feb 2011 17:38:20 +0000 (18:38 +0100)
committerStéphane Jacob <sj@m4x.org>
Sat, 12 Feb 2011 17:38:20 +0000 (18:38 +0100)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
classes/address.php

index edd0874..8d1fa48 100644 (file)
@@ -601,14 +601,14 @@ class Address
             $this->error = !empty($this->geocodedText);
         }
         if ($format['stripGeocoding'] || ($this->type == self::LINK_COMPANY && $this->error) || $this->geocodeChosen === '0') {
-            $gmapsGeocoder = new GMapsGeocoder();
-            $gmapsGeocoder->stripGeocodingFromAddress($this);
             if ($this->geocodeChosen === '0') {
                 $mailer = new PlMailer('profile/geocoding.mail.tpl');
                 $mailer->assign('text', $this->text);
                 $mailer->assign('geoloc', $this->geocodedText);
                 $mailer->send();
             }
+            $gmapsGeocoder = new GMapsGeocoder();
+            $gmapsGeocoder->stripGeocodingFromAddress($this);
         }
         if ($this->countryId == '') {
             $this->countryId = null;