Bug 14446 - Resolve "Use of uninitialized value in goto" in admin/preferences.pl
Summary: Resolve "Use of uninitialized value in goto" in admin/preferences.pl
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial
Assignee: Marcel de Rooy
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-24 04:51 UTC by Aleisha Amohia
Modified: 2019-10-14 19:56 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 14446: Workaround to resolve uninitialized value in goto warning (1.42 KB, patch)
2018-07-04 14:18 UTC, Marcel de Rooy
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 14446: Workaround to resolve uninitialized value in goto warning (1.39 KB, patch)
2018-07-06 00:15 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 14446: Workaround to resolve uninitialized value in goto warning (1.45 KB, patch)
2018-07-08 11:02 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Aleisha Amohia 2015-06-24 04:51:30 UTC
When using the syspref search bar, any search will trigger this warn:

Use of uninitialized value in goto at /home/vagrant/kohaclone/admin/preferences.pl line 57
Comment 1 Jonathan Druart 2015-07-02 16:12:30 UTC
It comes from the null option of the OpacRenewalBranch pref.
Comment 2 Marian 2018-01-17 07:48:09 UTC
I also have this problem did you have found a fix for it ?
Comment 3 Marcel de Rooy 2018-07-04 14:18:26 UTC
Created attachment 76685 [details] [review]
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: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Aleisha Amohia 2018-07-06 00:15:45 UTC
Created attachment 76712 [details] [review]
[SIGNED-OFF] 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 <aleishaamohia@hotmail.com>
Comment 5 Marcel de Rooy 2018-07-06 05:41:31 UTC
Thx Aleisha.

For QA:
The workaround is based on the fact that YAML::Syck contains this code:

sub Load {
    if (wantarray) {
        my ($rv) = YAML::Syck::LoadYAML( $_[0] );
        @{$rv};
    }
    else {
        @_ = $_[0];
        goto &YAML::Syck::LoadYAML;
    }
}
Comment 6 Katrin Fischer 2018-07-08 11:02:08 UTC
Created attachment 76756 [details] [review]
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 <aleishaamohia@hotmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 7 Nick Clemens (kidclamp) 2018-07-13 13:47:04 UTC
Awesome work all!

Pushed to master for 18.11
Comment 8 Martin Renvoize (ashimema) 2018-07-15 19:11:40 UTC
Pushed to 18.05.x for 18.05.02
Comment 9 Fridolin Somers 2018-07-30 12:55:20 UTC
Pushed to 17.11.x for 17.11.09
Comment 10 Fridolin Somers 2018-07-30 12:55:47 UTC
I choose not to push to 17.05.x