Bug 24529

Summary: Uninitialised value warnings in C4::Reserves
Product: Koha Reporter: Martin Renvoize (ashimema) <martin.renvoize>
Component: Architecture, internals, and plumbingAssignee: Martin Renvoize (ashimema) <martin.renvoize>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: 1joynelson, jonathan.druart
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00
Circulation function:
Bug Depends on: 24217    
Bug Blocks:    
Attachments: Bug 24529: Silence warnings for title level holds
Bug 24529: Silence another uninitialised value warning
Bug 24529: Silence warnings for title level holds
Bug 24529: Silence another uninitialised value warning

Description Martin Renvoize (ashimema) 2020-01-29 13:18:11 UTC
There is an uninitialised value warning coming from C4::Reserves which is causing a fair bit of noise when running the circulation tests.
Comment 1 Martin Renvoize (ashimema) 2020-01-29 13:21:25 UTC
Created attachment 98075 [details] [review]
Bug 24529: Silence warnings for title level holds

This patch simply adds a test for itemnumber being defined in the
reserve before comparing it to silence the warning.

Test plan:
1) Prior to patch, run prove t/db_dependant/Circulation.t and note lots
   of `Use of uninitialized value in numeric eq (==) at
   /kohadevbox/koha/C4/Reserves.pm line 790` warnings.
2) Apply the patch, re-run the test and note the tests still pass but
   the warnings are now gone.
Comment 2 Martin Renvoize (ashimema) 2020-01-29 13:25:32 UTC
Created attachment 98076 [details] [review]
Bug 24529: Silence another uninitialised value warning
Comment 3 Martin Renvoize (ashimema) 2020-01-29 13:26:50 UTC
Test plan:
Both t/db_dependant/Circulation.t and t/db_dependant/Reserves.t should pass before and after the patches but after they should not contain warnings from C4::Reserves.
Comment 4 Jonathan Druart 2020-01-29 14:57:55 UTC
Created attachment 98086 [details] [review]
Bug 24529: Silence warnings for title level holds

This patch simply adds a test for itemnumber being defined in the
reserve before comparing it to silence the warning.

Test plan:
1) Prior to patch, run prove t/db_dependant/Circulation.t and note lots
   of `Use of uninitialized value in numeric eq (==) at
   /kohadevbox/koha/C4/Reserves.pm line 790` warnings.
2) Apply the patch, re-run the test and note the tests still pass but
   the warnings are now gone.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 5 Jonathan Druart 2020-01-29 14:57:58 UTC
Created attachment 98087 [details] [review]
Bug 24529: Silence another uninitialised value warning

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Martin Renvoize (ashimema) 2020-02-05 12:39:08 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 7 Joy Nelson 2020-02-11 00:15:41 UTC
missing dependencies in 19.11.x 
not backported