Bug 20056 - Uninitialized warn in cmp_sysprefs.pl
Summary: Uninitialized warn in cmp_sysprefs.pl
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial
Assignee: Marcel de Rooy
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-22 08:49 UTC by Marcel de Rooy
Modified: 2019-10-14 19:56 UTC (History)
2 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 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, Mark 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 (kidclamp)
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 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 (kidclamp) 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 (kidclamp) 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