From 79ae09bffa5efc73ee1195ea06f8c14d399cef36 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 1 Jan 2012 02:57:55 +0000 Subject: [PATCH] prevent automatic geocoding when upgrading an old db, RT#15539 --- FS/FS/cust_main.pm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 73734df4c..7937a00b3 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -1499,12 +1499,14 @@ sub replace { } - $self->set_coord - if ! $self->coord_auto && ! $self->latitude && ! $self->longitude; + unless ( $import ) { + $self->set_coord + if ! $self->coord_auto && ! $self->latitude && ! $self->longitude; - $self->set_coord('ship_') - if $self->has_ship_address && ! $self->ship_coord_auto - && ! $self->ship_latitude && ! $self->ship_longitude; + $self->set_coord('ship_') + if $self->has_ship_address && ! $self->ship_coord_auto + && ! $self->ship_latitude && ! $self->ship_longitude; + } local($ignore_expired_card) = 1 if $old->payby =~ /^(CARD|DCRD)$/ @@ -4984,6 +4986,7 @@ sub _upgrade_data { #class method local($ignore_illegal_zip) = 1; local($ignore_banned_card) = 1; local($skip_fuzzyfiles) = 1; + local($import) = 1; #prevent automatic geocoding (need its own variable?) $class->_upgrade_otaker(%opts); } -- 2.11.0