Bug 25297

Summary: Consistent return value in K::A::Order->current_item_level_holds
Product: Koha Reporter: Tomás Cohen Arazi <tomascohen>
Component: Architecture, internals, and plumbingAssignee: Tomás Cohen Arazi <tomascohen>
Status: CLOSED FIXED QA Contact: Jonathan Druart <jonathan.druart>
Severity: enhancement    
Priority: P5 - low CC: 1joynelson, martin.renvoize
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
Bug Depends on: 24440, 25296    
Bug Blocks: 20212    
Attachments: Bug 25297: Regression tests
Bug 25297: Consistent return value in K::A::Order->current_item_level_holds
Bug 25297: Regression tests
Bug 25297: Consistent return value in K::A::Order->current_item_level_holds
Bug 25297: Regression tests
Bug 25297: Consistent return value in K::A::Order->current_item_level_holds

Description Tomás Cohen Arazi 2020-04-27 21:53:46 UTC
Right now it returns undef if there's no bilbio or items linked to the order. WE should rely on bug 25296 and return an empty Koha::Holds resultset.
Comment 1 Tomás Cohen Arazi 2020-04-27 21:58:59 UTC
Created attachment 103813 [details] [review]
Bug 25297: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 2 Tomás Cohen Arazi 2020-04-27 21:59:09 UTC
Created attachment 103814 [details] [review]
Bug 25297: Consistent return value in K::A::Order->current_item_level_holds

This patch makes the return values for 'current_item_level_holds'
consistent: they will always be a Koha::Holds iterator.

To test:
1. Apply the regression tests
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Acquisition/Order.t
=> FAIL: It doesn't work as expected, cannot call ->count on undef, etc
3. Apply this patch
4. Repeat 2.
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 3 Tomás Cohen Arazi 2020-04-27 22:02:31 UTC
*** Bug 24965 has been marked as a duplicate of this bug. ***
Comment 4 Frédéric Demians 2020-04-30 09:22:03 UTC
Created attachment 104008 [details] [review]
Bug 25297: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Comment 5 Frédéric Demians 2020-04-30 09:23:03 UTC
Created attachment 104009 [details] [review]
Bug 25297: Consistent return value in K::A::Order->current_item_level_holds

This patch makes the return values for 'current_item_level_holds'
consistent: they will always be a Koha::Holds iterator.

To test:
1. Apply the regression tests
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Acquisition/Order.t
=> FAIL: It doesn't work as expected, cannot call ->count on undef, etc
3. Apply this patch
4. Repeat 2.
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Comment 6 Jonathan Druart 2020-04-30 10:51:06 UTC
Created attachment 104014 [details] [review]
Bug 25297: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 7 Jonathan Druart 2020-04-30 10:51:09 UTC
Created attachment 104015 [details] [review]
Bug 25297: Consistent return value in K::A::Order->current_item_level_holds

This patch makes the return values for 'current_item_level_holds'
consistent: they will always be a Koha::Holds iterator.

To test:
1. Apply the regression tests
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Acquisition/Order.t
=> FAIL: It doesn't work as expected, cannot call ->count on undef, etc
3. Apply this patch
4. Repeat 2.
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Martin Renvoize 2020-05-01 07:20:17 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 9 Joy Nelson 2020-05-08 22:50:55 UTC
not backported to 19.11.x