Bug 14446

Summary: Resolve "Use of uninitialized value in goto" in admin/preferences.pl
Product: Koha Reporter: Aleisha Amohia <aleisha>
Component: System AdministrationAssignee: Marcel de Rooy <m.de.rooy>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: trivial    
Priority: P5 - low CC: fridolin.somers, gmcharlt, jonathan.druart, m.de.rooy, marianm, martin.renvoize, nick
Version: Main   
Hardware: All   
OS: All   
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
[SIGNED-OFF] Bug 14446: Workaround to resolve uninitialized value in goto warning
Bug 14446: Workaround to resolve uninitialized value in goto warning

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