[freeside-commits] branch master updated. 7685d697180f48048b8a98de84718a26d8fb58b7

Ivan ivan at 420.am
Wed May 8 04:10:50 PDT 2013


The branch, master has been updated
       via  7685d697180f48048b8a98de84718a26d8fb58b7 (commit)
      from  bee0671782e7a40961cf406cd7a10675fed6b3ba (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 7685d697180f48048b8a98de84718a26d8fb58b7
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed May 8 04:10:46 2013 -0700

    proceed with a CCH update even if some GEOCODE/tax_rate_location deletions can't be found, RT#21687

diff --git a/FS/FS/tax_rate_location.pm b/FS/FS/tax_rate_location.pm
index b4be8b9..aeb14d3 100644
--- a/FS/FS/tax_rate_location.pm
+++ b/FS/FS/tax_rate_location.pm
@@ -234,13 +234,14 @@ sub batch_import {
 
         $hash->{disabled} = '';
         my $tax_rate_location = qsearchs('tax_rate_location', $hash);
-        return "Can't find tax_rate_location to delete: ".
-               join(" ", map { "$_ => ". $hash->{$_} } @fields)
-          unless $tax_rate_location;
-
-        $tax_rate_location->disabled('Y');
-        my $error = $tax_rate_location->replace;
-        return $error if $error;
+        if ( $tax_rate_location ) {
+          $tax_rate_location->disabled('Y');
+          my $error = $tax_rate_location->replace;
+          return $error if $error;
+        } else {
+          warn "WARNING: Can't find tax_rate_location to delete, continuing update anyway: ".
+                 join(" ", map { "$_ => ". $hash->{$_} } @fields);
+        }
 
         delete($hash->{$_}) foreach (keys %$hash);
       }

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/tax_rate_location.pm |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)




More information about the freeside-commits mailing list