[freeside-commits] branch FREESIDE_3_BRANCH updated. 8625448a29bb6c05a4142b8261341c171fb30fb1

Christopher Burger burgerc at freeside.biz
Wed May 1 09:31:55 PDT 2019


The branch, FREESIDE_3_BRANCH has been updated
       via  8625448a29bb6c05a4142b8261341c171fb30fb1 (commit)
      from  c3a47e83c91dfa09252c46f142d52d79c82c3fa7 (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 8625448a29bb6c05a4142b8261341c171fb30fb1
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 b9fea779f..93b7235b7 100644
--- a/httemplate/edit/tower.html
+++ b/httemplate/edit/tower.html
@@ -46,16 +46,20 @@ my $m2_error_callback = sub { # reconstruct the list
     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