Bug 20056 - Uninitialized warn in cmp_sysprefs.pl
Summary: Uninitialized warn in cmp_sysprefs.pl
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low trivial (vote)
Assignee: Marcel de Rooy
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-22 08:49 UTC by Marcel de Rooy
Modified: 2018-06-04 20:15 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 20056: Resolve uninitialized warn in cmp_sysprefs.pl (1.22 KB, patch)
2018-01-22 08:52 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 20056: Resolve uninitialized warn in cmp_sysprefs.pl (1.23 KB, patch)
2018-01-26 02:39 UTC, M. Tompsett
Details | Diff | Splinter Review
Bug 20056: Resolve uninitialized warn in cmp_sysprefs.pl (1.29 KB, patch)
2018-01-26 18:35 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 M. 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 M. 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