From 0550e83adcd91851e9db324b4228d17a58895c26 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 11 Mar 2013 15:10:11 +0100 Subject: [PATCH] =?utf8?q?select=5Ftag():=20Funktionalit=C3=A4t=20von=20"w?= =?utf8?q?ith=5Fempty"=20wiederherstellen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Behebt #2208. --- SL/Presenter/Tag.pm | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/SL/Presenter/Tag.pm b/SL/Presenter/Tag.pm index 6fefd12be..29b57ad5d 100644 --- a/SL/Presenter/Tag.pm +++ b/SL/Presenter/Tag.pm @@ -108,10 +108,6 @@ sub select_tag { delete($attributes{default}); - - my @all_options; - push @all_options, [undef, $empty_title || ''] if $with_empty; - my $normalize_entry = sub { my ($type, $entry, $sub, $key) = @_; @@ -161,13 +157,14 @@ sub select_tag { return join '', map { $self->html_tag('option', $self->escape($_->[1]), value => $_->[0], selected => $_->[2]) } @options; }; - my $code; + my $code = ''; + $code .= $self->html_tag('option', $self->escape($empty_title || '')) if $with_empty; if (!$with_optgroups) { - $code = $list_to_code->($collection); + $code .= $list_to_code->($collection); } else { - $code = join '', map { + $code .= join '', map { my ($optgroup_title, $sub_collection) = @{ $_ }; $self->html_tag('optgroup', $list_to_code->($sub_collection), label => $optgroup_title) } @{ $collection }; -- 2.20.1