From b770676a6f8514d7e471974bb748a99e438e8fdd Mon Sep 17 00:00:00 2001 From: Aleisha Date: Tue, 5 May 2015 02:55:19 +0000 Subject: [PATCH] Bug 14145: Noisy warns in admin/preferences.pl This patch silences the warns on lines 116 and 121 by referring to the chunk variable name (type) rather than what I assume is the string 'multiple'. I don't know that this is the best solution for this, but the warns are gone and the page seems to work still. To test: 1) Go to Admin -> System Preferences and click on the OPAC tab 2) Notice the warns in the error log 3) Apply the patch and refresh page 4) Notice page still works but no warns in error log --- admin/preferences.pl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/admin/preferences.pl b/admin/preferences.pl index 1bd961e..96013b2 100755 --- a/admin/preferences.pl +++ b/admin/preferences.pl @@ -46,7 +46,7 @@ sub GetTab { my $tab_template = C4::Templates::gettemplate( 'admin/preferences/' . $tab . '.pref', 'intranet', $input ); my $active_currency = GetCurrency(); - my $local_currency; + my $local_currency;; if ($active_currency) { $local_currency = $active_currency->{currency}; } @@ -61,7 +61,7 @@ sub _get_chunk { my ( $value, %options ) = @_; my $name = $options{'pref'}; - my $chunk = { name => $name, value => $value, type => $options{'type'} || 'input', class => $options{'class'} }; + my $chunk = { name => $name, value => $value, type => $options{'type'} || 'input', class => $options{'class'} };; if ( $options{'class'} && $options{'class'} eq 'password' ) { $chunk->{'input_type'} = 'password'; @@ -108,18 +108,18 @@ sub _get_chunk { } elsif ( $options{'multiple'} ) { my @values = split /,/, $value; $chunk->{type} = 'multiple'; - $chunk->{CHOICES} = [ + $chunk->{CHOICES} = { sort { $a->{'text'} cmp $b->{'text'} } map { my $option_value = $_; { - text => $options{multiple}->{$option_value}, + text => $options{type}->{$option_value}, value => $option_value, selected => grep /^$option_value$/, @values, } } - keys %{ $options{multiple} } - ]; + keys %{ $options{type} } + }; } $chunk->{ 'type_' . $chunk->{'type'} } = 1; -- 1.7.10.4