diff options
Diffstat (limited to 'httemplate/elements/select-table.html')
-rw-r--r-- | httemplate/elements/select-table.html | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/httemplate/elements/select-table.html b/httemplate/elements/select-table.html index 6fb6b388b..a52fdfaaa 100644 --- a/httemplate/elements/select-table.html +++ b/httemplate/elements/select-table.html @@ -195,13 +195,22 @@ if ( ref( $value ) eq 'ARRAY' ) { $value = { map { $_ => 1 } @$value }; } -unless ( !ref($value) && $value < 1 # !$value #ignore negatives too - or ! exists( $opt{hashref}->{disabled} ) #?? - #or grep { $value == $_->$key() } @records - ) { + +if ( + (ref $value && $value) + or (ref $opt{hashref} && exists $opt{hashref}->{disabled}) + or $opt{also_show_option} +) { + delete $opt{hashref}->{disabled}; - foreach my $v ( ref($value) ? keys %$value : ($value) ) { + # also_show_option: (hack for change_pkg form): + # Include an absent select option, without selecting it + # as the curr_value + my @also_show = ref($value) ? keys %$value : ($value); + push @also_show, $opt{also_show_option} if $opt{also_show_option}; + + foreach my $v ( @also_show ) { next if grep { $v == $_->$key() } @records; $opt{hashref}->{$key} = $v; |