Bugzilla – Attachment 127476 Details for
Bug 24295
C4::Circulation::GetTransfers should be removed, use Koha::Item->get_transfer instead
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24295: Finally remove GetTransfers from C4/Circulation
Bug-24295-Finally-remove-GetTransfers-from-C4Circu.patch (text/plain), 3.87 KB, created by
Martin Renvoize (ashimema)
on 2021-11-09 11:53:27 UTC
(
hide
)
Description:
Bug 24295: Finally remove GetTransfers from C4/Circulation
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-11-09 11:53:27 UTC
Size:
3.87 KB
patch
obsolete
>From 2b4af610ffabfa04f09f2518c97b15306e01cbbd Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 19 Apr 2021 16:18:58 +0100 >Subject: [PATCH] Bug 24295: Finally remove GetTransfers from C4/Circulation > >This patch handles the final removal of GetTransfers from >C4::Circulation. > >Test plan >1/ Check that there is no mention of the GetTransfers method codebase >wide now >2/ Run the circulation and transfers tests and check nothing fails.. >perhaps even run the full test suit in k-t-d >3/ Signoff >--- > C4/Circulation.pm | 30 -------------------------- > t/db_dependent/Circulation/transfers.t | 21 +++--------------- > 2 files changed, 3 insertions(+), 48 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index c2edf81f94..20e552aac3 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -106,7 +106,6 @@ BEGIN { > > transferbook > TooMany >- GetTransfers > GetTransfersFromTo > updateWrongTransfer > CalcDateDue >@@ -3355,35 +3354,6 @@ sub AddIssuingCharge { > ); > } > >-=head2 GetTransfers >- >- GetTransfers($itemnumber); >- >-=cut >- >-sub GetTransfers { >- my ($itemnumber) = @_; >- >- my $dbh = C4::Context->dbh; >- >- my $query = ' >- SELECT datesent, >- frombranch, >- tobranch, >- branchtransfer_id, >- daterequested, >- reason >- FROM branchtransfers >- WHERE itemnumber = ? >- AND datearrived IS NULL >- AND datecancelled IS NULL >- '; >- my $sth = $dbh->prepare($query); >- $sth->execute($itemnumber); >- my @row = $sth->fetchrow_array(); >- return @row; >-} >- > =head2 GetTransfersFromTo > > @results = GetTransfersFromTo($frombranch,$tobranch); >diff --git a/t/db_dependent/Circulation/transfers.t b/t/db_dependent/Circulation/transfers.t >index e03b54fc02..ca6c37daa4 100755 >--- a/t/db_dependent/Circulation/transfers.t >+++ b/t/db_dependent/Circulation/transfers.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > use C4::Context; >-use C4::Circulation qw( CreateBranchTransferLimit DeleteBranchTransferLimits GetTransfers GetTransfersFromTo TransferSlip ); >+use C4::Circulation qw( CreateBranchTransferLimit DeleteBranchTransferLimits GetTransfersFromTo TransferSlip ); > use C4::Biblio qw( AddBiblio ); > use C4::Items qw( ModItemTransfer ); > use Koha::Database; >@@ -27,18 +27,17 @@ use Koha::Item::Transfers; > > use t::lib::TestBuilder; > >-use Test::More tests => 22; >+use Test::More tests => 19; > use Test::Deep; > > BEGIN { >- use_ok('C4::Circulation', qw( CreateBranchTransferLimit DeleteBranchTransferLimits GetTransfers GetTransfersFromTo TransferSlip )); >+ use_ok('C4::Circulation', qw( CreateBranchTransferLimit DeleteBranchTransferLimits GetTransfersFromTo TransferSlip )); > } > can_ok( > 'C4::Circulation', > qw( > CreateBranchTransferLimit > DeleteBranchTransferLimits >- GetTransfers > GetTransfersFromTo > ) > ); >@@ -168,20 +167,6 @@ is(CreateBranchTransferLimit(undef,$branchcode_2),undef, > #branch_transfer_limits.toBranch and branch_transfer_limits.fromBranch aren't foreign keys > #is(CreateBranchTransferLimit(-1,-1,'CODE'),0,"With wrong CreateBranchTransferLimit returns 0 - No transfertlimit added"); > >-#Test GetTransfers >-my @transfers = GetTransfers($item_id1); >-cmp_deeply( >- \@transfers, >- [ re('^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$'), $branchcode_1, $branchcode_2, re('[0-9]*'), re('^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$'), 'Manual' ], >- "Transfers of the item1" >-); #NOTE: Only the first transfer is returned >-@transfers = GetTransfers; >-is_deeply( \@transfers, [], >- "GetTransfers without params returns an empty array" ); >-@transfers = GetTransfers(-1); >-is_deeply( \@transfers, [], >- "GetTransfers with a wrong item id returns an empty array" ); >- > #Test GetTransfersFromTo > my @transferfrom1to2 = GetTransfersFromTo( $branchcode_1, > $branchcode_2 ); >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24295
:
118242
|
118243
|
118244
|
118245
|
118246
|
118247
|
118248
|
118249
|
118250
|
118287
|
118295
|
118296
|
118297
|
118298
|
118299
|
118300
|
118301
|
118302
|
118303
|
118304
|
118305
|
118306
|
118307
|
118308
|
118309
|
118310
|
119854
|
119855
|
119856
|
119857
|
119858
|
119859
|
119860
|
119861
|
119862
|
119863
|
119864
|
119866
|
119867
|
127465
|
127466
|
127467
|
127468
|
127469
|
127470
|
127471
|
127472
|
127473
|
127474
|
127475
|
127476
|
127477
|
130430
|
130431
|
130432
|
130433
|
130434
|
130435
|
130436
|
130437
|
130438
|
130439
|
130440
|
130441
|
130442
|
139546
|
139547
|
139548
|
139549
|
139550
|
139551
|
139552
|
139553
|
139554
|
139555
|
139556
|
139557
|
139558
|
139655
|
139656
|
139657
|
139658
|
139659
|
139660
|
139661
|
139662
|
139663
|
139664
|
139665
|
139666
|
139667