From 628f212ed946f9a8f1114269c8927da0606aed29 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 4 Jul 2018 16:03:33 +0200 Subject: [PATCH] Bug 14446: Workaround to resolve uninitialized value in goto warning Forcing both GetTab calls to list context resolves the warning. A workaround, not a real fix. Test plan: Search for something in the syspref text bar. Without this patch, you will have a warn: Use of uninitialized value in goto With this patch, you won't. Signed-off-by: Aleisha Amohia Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens Signed-off-by: Martin Renvoize (cherry picked from commit 1d6760f01a674ff52d96a1a342d68a7e5c9a6c8a) Signed-off-by: Fridolin Somers --- admin/preferences.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/admin/preferences.pl b/admin/preferences.pl index 032789fb82..8a4778154b 100755 --- a/admin/preferences.pl +++ b/admin/preferences.pl @@ -229,7 +229,8 @@ sub SearchPrefs { our @terms = split( /\s+/, $searchfield ); foreach my $tab_name ( keys %tab_files ) { - my $data = GetTab( $input, $tab_name ); + # Force list context to remove 'uninitialized value in goto' warn coming from YAML::Syck; note that the other GetTab call is in list context too. The actual cause however is the null value for the pref OpacRenewalBranch in opac.pref + my ($data) = GetTab( $input, $tab_name ); my $title = ( keys( %$data ) )[0]; my $tab = $data->{ $title }; $tab = { '' => $tab } if ( ref( $tab ) eq 'ARRAY' ); -- 2.39.5