Merge branch 'patch-3' of https://github.com/gjones2/Freeside (fix closing tag)
[freeside.git] / FS / FS / cust_main / Location.pm
index d1d6d67..ba3513b 100644 (file)
@@ -8,7 +8,7 @@ use FS::cust_location;
 
 use Carp qw(carp);
 
-$DEBUG = 1;
+$DEBUG = 0;
 $me = '[FS::cust_main::Location]';
 
 my $init = 0;
@@ -18,7 +18,8 @@ BEGIN {
     no strict 'refs';
     @location_fields = 
       qw( address1 address2 city county state zip country district
-        latitude longitude coord_auto censustract censusyear geocode );
+        latitude longitude coord_auto censustract censusyear geocode
+        addr_clean );
 
     foreach my $f (@location_fields) {
       *{"FS::cust_main::Location::$f"} = sub {
@@ -146,7 +147,7 @@ sub _upgrade_data {
     # just in case someone still doesn't have these
     if ( !$phone_type{$_}->phonetypenum ) {
       $error = $phone_type{$_}->insert;
-      die "error creating phone type '$_': $error";
+      die "error creating phone type '$_': $error" if $error;
     }
   }