Bug 31328

Summary: Make Koha::Item->get_transfer* use 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: lucas, martin.renvoize
Version: unspecified   
Hardware: All   
OS: All   
GIT URL: 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: 31183    
Bug Blocks:    
Attachments: Bug 31328: Make Koha::Item->get_transfer* use Koha::Item::Transfers->filter_by_current
Bug 31328: Make Koha::Item->get_transfer* use Koha::Item::Transfers->filter_by_current
Bug 31328: Call get_transfers from get_transfer
Bug 31328: Make Koha::Item->get_transfer* use Koha::Item::Transfers->filter_by_current
Bug 31328: Call get_transfers from get_transfer

Description Tomás Cohen Arazi (tcohen) 2022-08-09 11:39:42 UTC

    
Comment 1 Tomás Cohen Arazi (tcohen) 2022-08-09 11:43:00 UTC
Created attachment 138899 [details] [review]
Bug 31328: Make Koha::Item->get_transfer* use Koha::Item::Transfers->filter_by_current

This patch makes the get_transfer and get_transfers methods internally
use the new ->filter_by_current method.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Item.t
=> SUCCESS: Tests pass!
2. Apply this rewriting patch
3. Repeat 1
=> SUCCESS: Tests still pass!
4. Sign off :-D
Comment 2 Jonathan Druart 2022-08-10 13:38:07 UTC
Created attachment 138983 [details] [review]
Bug 31328: Make Koha::Item->get_transfer* use Koha::Item::Transfers->filter_by_current

This patch makes the get_transfer and get_transfers methods internally
use the new ->filter_by_current method.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 3 Jonathan Druart 2022-08-10 13:38:11 UTC
Created attachment 138984 [details] [review]
Bug 31328: Call get_transfers from get_transfer

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 4 Martin Renvoize (ashimema) 2022-08-10 14:01:55 UTC
Created attachment 138990 [details] [review]
Bug 31328: Make Koha::Item->get_transfer* use Koha::Item::Transfers->filter_by_current

This patch makes the get_transfer and get_transfers methods internally
use the new ->filter_by_current method.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 5 Martin Renvoize (ashimema) 2022-08-10 14:01:59 UTC
Created attachment 138991 [details] [review]
Bug 31328: Call get_transfers from get_transfer

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Tomás Cohen Arazi (tcohen) 2022-08-16 12:20:58 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 7 Lucas Gass (lukeg) 2022-09-30 23:12:41 UTC
Enhancement will not be backported to 22.05.x series