[freeside-commits] branch master updated. a5496f56c0c9755e1aa268b9a979cd81e59243c3

Christopher Burger burgerc at freeside.biz
Wed May 1 09:07:06 PDT 2019


The branch, master has been updated
       via  a5496f56c0c9755e1aa268b9a979cd81e59243c3 (commit)
      from  74200be4e8f20a86e103e447bb19c301abffdb4b (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 a5496f56c0c9755e1aa268b9a979cd81e59243c3
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Wed May 1 12:06:18 2019 -0400

    RT# 83205 - fixed error with fields being sticky on error

diff --git a/httemplate/edit/tower.html b/httemplate/edit/tower.html
index dfebc0031..f2faa5a9a 100644
--- a/httemplate/edit/tower.html
+++ b/httemplate/edit/tower.html
@@ -50,16 +50,20 @@ my $m2_error_callback = sub { # reconstruct the list
     sectorname ip_addr height freq_mhz direction width tilt v_width db_high db_low sector_range up_rate_limit down_rate_limit
   );
 
-  map {
-    my $k = $_;
-    new FS::tower_sector {
-      'towernum'  => $object->towernum,
-      'sectornum' => scalar( $cgi->param($k) ),
-      map { $_ => scalar( $cgi->param($k.'_'.$_) ) } @fields,
-    };
-  } grep length($cgi->param($_.'_sectorname')),
-      grep /^sectornum\d+$/,
-        ($cgi->param);
+  my @sectors;
+  foreach my $k ($cgi->param) {
+    if ($k =~ /^sectornum\d+$/) {
+      my $sectornum = $cgi->param($k);
+      my $sector = FS::tower_sector->new({
+        'sectornum' => $sectornum,
+        'towernum'  => $object->towernum,
+        map { $_ => scalar($cgi->param($k.'_'.$_)) } @fields,
+      });
+      push @sectors, $sector if length($sector->sectorname) && $sector->sectorname ne '_default';
+    }
+  }
+
+  return @sectors;
 };
 
 my $default_ip_addr_callback = sub {

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

Summary of changes:
 httemplate/edit/tower.html | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)




More information about the freeside-commits mailing list