Bug 20056

Summary: Uninitialized warn in cmp_sysprefs.pl
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: Architecture, internals, and plumbingAssignee: Marcel de Rooy <m.de.rooy>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: trivial    
Priority: P5 - low CC: mtompset, 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:
Attachments: Bug 20056: Resolve uninitialized warn in cmp_sysprefs.pl
Bug 20056: Resolve uninitialized warn in cmp_sysprefs.pl
Bug 20056: Resolve uninitialized warn in cmp_sysprefs.pl

Description Marcel de Rooy 2018-01-22 08:49:29 UTC
Use of uninitialized value in addition (+) at misc/maintenance/cmp_sysprefs.pl line 125.
Comment 1 Marcel de Rooy 2018-01-22 08:52:49 UTC
Created attachment 70789 [details] [review]
Bug 20056: Resolve uninitialized warn in cmp_sysprefs.pl

When running a compare with --upd flag, I got the following warn:
    Use of uninitialized value in addition (+) at misc/maintenance/cmp_sysprefs.pl line 125.
This is simply resolved by not returning undef but 0 in case of the Version
syspref in the sub UpdateOnePref.

Test plan:
Look at this simple change.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 2 Mark Tompsett 2018-01-26 02:38:01 UTC
TEST PLAN
---------
0) Back up database as desired.
1) Run the following commands:
   $ kshell
   k$ ./misc/maintenance/cmp_sysprefs.pl -cmd backup -file ~/sysprefs.bak
2) Go to the local tab of the system preferences in the staff client.
3) Reduce the last digit of version by one and save
   -- it will force you into an upgrade screen login.
   -- Don't upgrade!
4) Run the following commands:
    k$ ./misc/maintenance/cmp_sysprefs.pl -cmd compare -file ~/syspref.bak -upd
   -- Warning encountered from comment #0.
5) Run the following commands:
    k$ exit
    $ git bz apply 20056
    $ kshell
    k$ ./misc/maintenance/cmp_sysprefs.pl -cmd compare -file ~/syspref.bak -upd
    k$ exit
   -- Warning was silenced.
6) Either restore db or reset_all
7) run koha qa test tools.
Comment 3 Mark Tompsett 2018-01-26 02:39:30 UTC
Created attachment 70930 [details] [review]
Bug 20056: Resolve uninitialized warn in cmp_sysprefs.pl

When running a compare with --upd flag, I got the following warn:
    Use of uninitialized value in addition (+) at misc/maintenance/cmp_sysprefs.pl line 125.
This is simply resolved by not returning undef but 0 in case of the Version
syspref in the sub UpdateOnePref.

Test plan:
Look at this simple change.

See comment #2 for fuller test plan.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 4 Marcel de Rooy 2018-01-26 06:29:19 UTC
(In reply to M. Tompsett from comment #3)
> See comment #2 for fuller test plan.
> Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Thanks !
Comment 5 Nick Clemens 2018-01-26 18:35:28 UTC
Created attachment 70970 [details] [review]
Bug 20056: Resolve uninitialized warn in cmp_sysprefs.pl

When running a compare with --upd flag, I got the following warn:
    Use of uninitialized value in addition (+) at misc/maintenance/cmp_sysprefs.pl line 125.
This is simply resolved by not returning undef but 0 in case of the Version
syspref in the sub UpdateOnePref.

Test plan:
Look at this simple change.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 6 Jonathan Druart 2018-01-30 17:26:31 UTC
Pushed to master for 18.05, thanks to everybody involved!
Comment 7 Nick Clemens 2018-02-12 20:56:16 UTC
Awesome work all!

This patch has been pushed to 17.11.x and will be in 17.11.03