summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Burger <burgerc@freeside.biz>2019-05-01 12:06:18 -0400
committerChristopher Burger <burgerc@freeside.biz>2019-05-01 12:12:50 -0400
commit635874f1ea13ab971d2f8b95bfd0ca25eed0aaef (patch)
tree3f1a7ab55f1f298155b66ed6d60b47260d403b5b
parent02499cf576319fc0cf260314876e91e1235f2f96 (diff)
RT# 83205 - fixed error with fields being sticky on error
-rw-r--r--httemplate/edit/tower.html24
1 files changed, 14 insertions, 10 deletions
diff --git a/httemplate/edit/tower.html b/httemplate/edit/tower.html
index b9fea77..93b7235 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 {