To recreate: 0 - set AllowHoldItemTypeSelection to 'Allow' 1 - Place a title level hold for a record with an item from Library A for delivery at Library A for a patron from Library A with an itemtype specified 2 - perl misc/cronjobs/holds/build_holds_queue.pl 3 - There are warns: Use of uninitialized value in hash element at /kohadevbox/koha/C4/HoldsQueue.pm line 523. Use of uninitialized value in string eq at /kohadevbox/koha/C4/HoldsQueue.pm line 523.
Created attachment 109620 [details] [review] Bug 26367: Unit test This warn only appears when: The borrower and item branches match AND The hold fulfillment policy is any or the pickupbranch matches the items branch specified by hold_fulfillment_policy AND The request has an itemtype set To trigger we simply add some itemtype to existing hold requests in the test To test: 1 - prove -v t/db_dependent/HoldsQueue.t
Created attachment 109621 [details] [review] Bug 26367: Prevent warn about undefined values when record level hold has an itemtype To test: 1 - set AllowHoldItemTypeSelection to 'Allow' 2 - Find a patron from Library A 3 - Find a record with an item from Library A 4 - Place a title level hold with itemtype specified for a delivery at Library A for patron and record above 5 - perl misc/cronjobs/holds/build_holds_queue.pl 6 - There are warns: Use of uninitialized value in hash element at /kohadevbox/koha/C4/HoldsQueue.pm line 523. Use of uninitialized value in string eq at /kohadevbox/koha/C4/HoldsQueue.pm line 523 7 - Apply this patch 8 - perl misc/cronjobs/holds/build_holds_queue.pl 9 - No more warns! 10 - prove -v t/db_dependent/HoldsQueue.t 11 - All tests pass!
Created attachment 113031 [details] [review] Bug 26367: Unit test This warn only appears when: The borrower and item branches match AND The hold fulfillment policy is any or the pickupbranch matches the items branch specified by hold_fulfillment_policy AND The request has an itemtype set To trigger we simply add some itemtype to existing hold requests in the test To test: 1 - prove -v t/db_dependent/HoldsQueue.t Signed-off-by: David Nind <david@davidnind.com>
Created attachment 113032 [details] [review] Bug 26367: Prevent warn about undefined values when record level hold has an itemtype To test: 1 - set AllowHoldItemTypeSelection to 'Allow' 2 - Find a patron from Library A 3 - Find a record with an item from Library A 4 - Place a title level hold with itemtype specified for a delivery at Library A for patron and record above 5 - perl misc/cronjobs/holds/build_holds_queue.pl 6 - There are warns: Use of uninitialized value in hash element at /kohadevbox/koha/C4/HoldsQueue.pm line 523. Use of uninitialized value in string eq at /kohadevbox/koha/C4/HoldsQueue.pm line 523 7 - Apply this patch 8 - perl misc/cronjobs/holds/build_holds_queue.pl 9 - No more warns! 10 - prove -v t/db_dependent/HoldsQueue.t 11 - All tests pass! Signed-off-by: David Nind <david@davidnind.com>
Testing notes - to generate the warnings when build_holds_queue.pl is run (using koha-testing-docker): 1. In staff interface change the library to Midway. 2. Search the catalog for Xenophōntos Agēsilaos. 3. Click on 'Place hold'. 4. For the patron choose Henry Acevedo. 5. For hold details for "Request specific item type" select "Books", then Place hold.
Created attachment 114823 [details] [review] Bug 26367: Unit test This warn only appears when: The borrower and item branches match AND The hold fulfillment policy is any or the pickupbranch matches the items branch specified by hold_fulfillment_policy AND The request has an itemtype set To trigger we simply add some itemtype to existing hold requests in the test To test: 1 - prove -v t/db_dependent/HoldsQueue.t Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 114824 [details] [review] Bug 26367: Prevent warn about undefined values when record level hold has an itemtype To test: 1 - set AllowHoldItemTypeSelection to 'Allow' 2 - Find a patron from Library A 3 - Find a record with an item from Library A 4 - Place a title level hold with itemtype specified for a delivery at Library A for patron and record above 5 - perl misc/cronjobs/holds/build_holds_queue.pl 6 - There are warns: Use of uninitialized value in hash element at /kohadevbox/koha/C4/HoldsQueue.pm line 523. Use of uninitialized value in string eq at /kohadevbox/koha/C4/HoldsQueue.pm line 523 7 - Apply this patch 8 - perl misc/cronjobs/holds/build_holds_queue.pl 9 - No more warns! 10 - prove -v t/db_dependent/HoldsQueue.t 11 - All tests pass! Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Pushed to master for 21.05, thanks to everybody involved!
Pushed to 20.11.x for 20.11.02
Doesn't apply cleanly to 20.05.x, please rebase
(In reply to Andrew Fuerste-Henry from comment #10) > Doesn't apply cleanly to 20.05.x, please rebase The tests for this rely on 19889, it reduces warns but does not affect functionality, can be skipped
*** Bug 26387 has been marked as a duplicate of this bug. ***