Bug 31183

Summary: Add Koha::Item::Transfers->filter_by_current
Product: Koha Reporter: Tomás Cohen Arazi (tcohen) <tomascohen>
Component: Architecture, internals, and plumbingAssignee: Tomás Cohen Arazi (tcohen) <tomascohen>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: jonathan.druart, lucas
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00
Circulation function:
Bug Depends on: 30447    
Bug Blocks: 31328    
Attachments: Bug 31183: Unit tests
Bug 31183: Add Koha::Item::Transfers->filter_by_current
Bug 31183: Use filter_by_current in Koha::Holds->get_items_that_can_fill
Bug 31183: Unit tests
Bug 31183: Add Koha::Item::Transfers->filter_by_current
Bug 31183: Use filter_by_current in Koha::Holds->get_items_that_can_fill
Bug 31183: Unit tests
Bug 31183: Add Koha::Item::Transfers->filter_by_current
Bug 31183: Use filter_by_current in Koha::Holds->get_items_that_can_fill

Description Tomás Cohen Arazi (tcohen) 2022-07-18 21:32:27 UTC

    
Comment 1 Tomás Cohen Arazi (tcohen) 2022-07-18 21:48:26 UTC
Created attachment 137851 [details] [review]
Bug 31183: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 2 Tomás Cohen Arazi (tcohen) 2022-07-18 21:48:30 UTC
Created attachment 137852 [details] [review]
Bug 31183: Add Koha::Item::Transfers->filter_by_current

This patch introduces the aforementioned method.

To test:
1. Apply this unit tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Item/Transfers.t
=> FaIL: method not defined?
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 (tcohen) 2022-07-18 21:48:34 UTC
Created attachment 137853 [details] [review]
Bug 31183: Use filter_by_current in Koha::Holds->get_items_that_can_fill

This patch makes the method use the new
Koha::Item::Transfers->filter_by_current one.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Holds.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests still pass
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 4 Michal Urban 2022-07-20 17:07:18 UTC
Created attachment 137944 [details] [review]
Bug 31183: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 5 Michal Urban 2022-07-20 17:07:22 UTC
Created attachment 137945 [details] [review]
Bug 31183: Add Koha::Item::Transfers->filter_by_current

This patch introduces the aforementioned method.

To test:
1. Apply this unit tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Item/Transfers.t
=> FaIL: method not defined?
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 6 Michal Urban 2022-07-20 17:07:25 UTC
Created attachment 137946 [details] [review]
Bug 31183: Use filter_by_current in Koha::Holds->get_items_that_can_fill

This patch makes the method use the new
Koha::Item::Transfers->filter_by_current one.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Holds.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests still pass
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Michal Urban <michalurban177@gmail.com>
Comment 7 Jonathan Druart 2022-08-09 09:34:28 UTC
Created attachment 138887 [details] [review]
Bug 31183: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Jonathan Druart 2022-08-09 09:34:32 UTC
Created attachment 138888 [details] [review]
Bug 31183: Add Koha::Item::Transfers->filter_by_current

This patch introduces the aforementioned method.

To test:
1. Apply this unit tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Item/Transfers.t
=> FaIL: method not defined?
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: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 9 Jonathan Druart 2022-08-09 09:34:37 UTC
Created attachment 138889 [details] [review]
Bug 31183: Use filter_by_current in Koha::Holds->get_items_that_can_fill

This patch makes the method use the new
Koha::Item::Transfers->filter_by_current one.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Holds.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests still pass
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Michal Urban <michalurban177@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 10 Jonathan Druart 2022-08-09 09:36:25 UTC
Shouldn't we use it from Koha::Item->get_transfers as well?
Comment 11 Tomás Cohen Arazi (tcohen) 2022-08-09 10:55:06 UTC
(In reply to Jonathan Druart from comment #10)
> Shouldn't we use it from Koha::Item->get_transfers as well?

Yes! I forgot!
Comment 12 Tomás Cohen Arazi (tcohen) 2022-08-09 11:46:44 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 13 Lucas Gass (lukeg) 2022-09-30 22:38:08 UTC
Enhancement will not be backported to 22.05.x series unless requested