Bug 25297 - Consistent return value in K::A::Order->current_item_level_holds
Summary: Consistent return value in K::A::Order->current_item_level_holds
Status: Pushed to master
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Jonathan Druart
URL:
Keywords:
: 24965 (view as bug list)
Depends on: 25296 24440
Blocks: 20212
  Show dependency treegraph
 
Reported: 2020-04-27 21:53 UTC by Tomás Cohen Arazi
Modified: 2020-05-08 22:50 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
20.05.00


Attachments
Bug 25297: Regression tests (1.90 KB, patch)
2020-04-27 21:58 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 25297: Consistent return value in K::A::Order->current_item_level_holds (1.95 KB, patch)
2020-04-27 21:59 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 25297: Regression tests (2.04 KB, patch)
2020-04-30 09:22 UTC, Frédéric Demians
Details | Diff | Splinter Review
Bug 25297: Consistent return value in K::A::Order->current_item_level_holds (2.10 KB, patch)
2020-04-30 09:23 UTC, Frédéric Demians
Details | Diff | Splinter Review
Bug 25297: Regression tests (2.11 KB, patch)
2020-04-30 10:51 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 25297: Consistent return value in K::A::Order->current_item_level_holds (2.17 KB, patch)
2020-04-30 10:51 UTC, Jonathan Druart
Details | Diff | Splinter Review

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