Bugzilla – Attachment 20616 Details for
Bug 10698
DeleteTransfer in C4::Circulation.pm needs return value
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10698: DeleteTransfer in C4::Circulation.pm needs return value
Bug-10698-DeleteTransfer-in-C4Circulationpm-needs-.patch (text/plain), 2.61 KB, created by
Bernardo Gonzalez Kriegel
on 2013-08-25 22:44:27 UTC
(
hide
)
Description:
Bug 10698: DeleteTransfer in C4::Circulation.pm needs return value
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2013-08-25 22:44:27 UTC
Size:
2.61 KB
patch
obsolete
>From c2d42caf289142207655141762d7d2110241bbc0 Mon Sep 17 00:00:00 2001 >From: Kenza Zaki <kenza.zaki@biblibre.com> >Date: Thu, 8 Aug 2013 10:39:26 +0200 >Subject: [PATCH] Bug 10698: DeleteTransfer in C4::Circulation.pm needs return > value > >This patch adds return values to DeleteTransfer: >Undef if no parameters are given >1 if a Transfer is deleted >0E0 if a wrong parameter is given > >It also fixes some unit tests in t/db_dependent/Circulation_transfers.t > >To test: >prove t/db_dependent/Circulation_transfers.t >t/db_dependent/Circulation_transfers.t .. ok >All tests successful. >Files=1, Tests=14, 20 wallclock secs ( 0.03 usr 0.00 sys + 0.39 cusr 0.02 csys = 0.44 CPU) >Result: PASS > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Comment: Applied 10681 and 10692 before 10698 >Run prove t/db_dependent/Circulation_transfers.t without errors >No koha-qa errors on all 3 patches >--- > C4/Circulation.pm | 3 ++- > t/db_dependent/Circulation_transfers.t | 6 +++--- > 2 files changed, 5 insertions(+), 4 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 02fe6b0..9879430 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2826,13 +2826,14 @@ sub GetTransfersFromTo { > > sub DeleteTransfer { > my ($itemnumber) = @_; >+ return unless $itemnumber; > my $dbh = C4::Context->dbh; > my $sth = $dbh->prepare( > "DELETE FROM branchtransfers > WHERE itemnumber=? > AND datearrived IS NULL " > ); >- $sth->execute($itemnumber); >+ return $sth->execute($itemnumber); > } > > =head2 AnonymiseIssueHistory >diff --git a/t/db_dependent/Circulation_transfers.t b/t/db_dependent/Circulation_transfers.t >index 927b87c..9982c53 100644 >--- a/t/db_dependent/Circulation_transfers.t >+++ b/t/db_dependent/Circulation_transfers.t >@@ -9,7 +9,7 @@ use C4::Circulation; > use Koha::DateUtils; > use DateTime::Duration; > >-use Test::More tests => 12; >+use Test::More tests => 14; > > BEGIN { > use_ok('C4::Circulation'); >@@ -191,8 +191,8 @@ is( > is( C4::Circulation::DeleteTransfer($item_id1), > 1, "A the item1's transfer has been deleted" ); > #FIXME :The following tests should pass but don't because currently the routine DeleteTransfer returns nothing >-#is(C4::Circulation::DeleteTransfer(),undef,"Without itemid DeleteTransfer returns undef"); >-#is(C4::Circulation::DeleteTransfer(-1),0,"with a wrong itemid DeleteTranfer returns 0"); >+is(C4::Circulation::DeleteTransfer(),undef,"Without itemid DeleteTransfer returns undef"); >+is(C4::Circulation::DeleteTransfer(-1),'0E0',"with a wrong itemid DeleteTranfer returns 0E0"); > > #End transaction > $dbh->rollback; >-- >1.7.9.5
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 10698
:
20160
|
20616
|
20648