From 89c9d370754d17757566d3c9c50198c97ddc814c Mon Sep 17 00:00:00 2001 From: dman776 Date: Tue, 29 Jan 2019 12:20:37 -0600 Subject: [PATCH] bugfix: new settings will now show after a conditional setting (#343) --- files/www/cgi-bin/advancedconfig | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/files/www/cgi-bin/advancedconfig b/files/www/cgi-bin/advancedconfig index 2a842d43..fb5a99a9 100755 --- a/files/www/cgi-bin/advancedconfig +++ b/files/www/cgi-bin/advancedconfig @@ -146,14 +146,14 @@ for($i=0;$i<$scount;$i++) $newval=~ s/^\s+|\s+$//; if ($setting[$i]->{'type'} eq "boolean") { - if ($newval) - { - $newval="1"; - } - else - { - $newval="0"; - } + if ($newval) + { + $newval="1"; + } + else + { + $newval="0"; + } } $key=$setting[$i]->{'key'}; @x=split(/\./, $setting[$i]->{'key'}); @@ -227,7 +227,11 @@ foreach(@setting) # check to see if setting is conditional if($setting[$scount]->{'condition'}) { - next if !eval $setting[$scount]->{'condition'}; + if (!eval $setting[$scount]->{'condition'}) + { + $scount++; + next; + } } $sconfig = $_->{'key'}; $sval = `uci -q get '$sconfig'`;