strip degree signs from coord fields before saving CGI param state, workaround for...
authorMark Wells <mark@freeside.biz>
Wed, 3 Aug 2016 23:16:28 +0000 (16:16 -0700)
committerJonathan Prykop <jonathan@freeside.biz>
Thu, 4 Aug 2016 00:33:51 +0000 (19:33 -0500)
httemplate/edit/process/cust_main.cgi

index 6961d18..a9439fa 100755 (executable)
@@ -80,6 +80,12 @@ if ( $conf->exists('agent-ship_address', $cgi->param('agentnum')) ) {
 my %locations;
 for my $pre (qw(bill ship)) {
 
+  foreach (qw( latitude longitude)) {
+    my $coord = $cgi->param($pre.'_'.$_);
+    $coord =~ s/\N{DEGREE SIGN}\s*$//;
+    $cgi->param($pre.'_'.$_, $coord);
+  }
+
   my %hash;
   foreach ( FS::cust_main->location_fields ) {
     $hash{$_} = scalar($cgi->param($pre.'_'.$_));