[freeside-commits] branch master updated. 9d963d1e6270bf67f385a4b5fda4e51cdf4e79ed

Jonathan Prykop jonathan at 420.am
Wed Aug 3 10:27:36 PDT 2016


The branch, master has been updated
       via  9d963d1e6270bf67f385a4b5fda4e51cdf4e79ed (commit)
      from  34c878349988d97957f1d53427896a4d70afb392 (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 9d963d1e6270bf67f385a4b5fda4e51cdf4e79ed
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Wed Aug 3 12:27:05 2016 -0500

    RT#71518: Bug in the address editor

diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm
index 7ec8117..c3d3973 100644
--- a/FS/FS/Record.pm
+++ b/FS/FS/Record.pm
@@ -2,6 +2,7 @@ package FS::Record;
 use base qw( Exporter );
 
 use strict;
+use charnames ':full';
 use vars qw( $AUTOLOAD
              %virtual_fields_cache %fk_method_cache $fk_table_cache
              $money_char $lat_lower $lon_upper
@@ -2913,6 +2914,10 @@ sub ut_coord {
   my $coord = $self->getfield($field);
   my $neg = $coord =~ s/^(-)//;
 
+  # ignore degree symbol at the end,
+  #   but not otherwise supporting degree/minutes/seconds symbols
+  $coord =~ s/\N{DEGREE SIGN}\s*$//;
+
   my ($d, $m, $s) = (0, 0, 0);
 
   if (
diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi
index 39cddc0..b314d2d 100755
--- a/httemplate/edit/cust_main.cgi
+++ b/httemplate/edit/cust_main.cgi
@@ -203,12 +203,19 @@ if ( $cgi->param('error') ) {
   my %locations;
   for my $pre (qw(bill ship)) {
     my %hash;
-    foreach ( FS::cust_main->location_fields ) {
-      $hash{$_} = scalar($cgi->param($pre.'_'.$_));
+    foreach my $locfield ( FS::cust_main->location_fields ) {
+      # don't search on lat/long, string values can cause qsearchs to die
+      next if grep {$_ eq $locfield} qw(latitude longitude);
+      $hash{$locfield} = scalar($cgi->param($pre.'_'.$locfield));
     }
     $hash{'custnum'} = $cgi->param('custnum');
     $locations{$pre} = qsearchs('cust_location', \%hash)
                        || FS::cust_location->new( \%hash );
+    # now set lat/long, for redisplay of entered values
+    foreach my $locfield ( qw(latitude longitude) ) {
+      my $locvalue = scalar($cgi->param($pre.'_'.$locfield));
+      $locations{$pre}->set($locfield,$locvalue);
+    }
   }
   if ( $same ) {
     $locations{ship} = $locations{bill};

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

Summary of changes:
 FS/FS/Record.pm               |    5 +++++
 httemplate/edit/cust_main.cgi |   11 +++++++++--
 2 files changed, 14 insertions(+), 2 deletions(-)




More information about the freeside-commits mailing list