Bugzilla – Attachment 23567 Details for
Bug 11336
Priority is not updated on deleting holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11336: (follow-up) Priority is not updated on deleting holds - moremember
Bug-11336-follow-up-Priority-is-not-updated-on-del.patch (text/plain), 2.92 KB, created by
Jonathan Druart
on 2013-12-16 09:46:38 UTC
(
hide
)
Description:
Bug 11336: (follow-up) Priority is not updated on deleting holds - moremember
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-12-16 09:46:38 UTC
Size:
2.92 KB
patch
obsolete
>From 0160aa021d3084a1aa065df4288f57469dfd7c87 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Fri, 13 Dec 2013 13:03:20 -0500 >Subject: [PATCH] Bug 11336: (follow-up) Priority is not updated on deleting > holds - moremember > >Patch does not fix issue when canceling hold from moremember.pl. >This followup fixes that issue. >--- > C4/Reserves.pm | 23 +---------------------- > t/db_dependent/Holds.t | 26 ++++++++++++++++++++++++-- > 2 files changed, 25 insertions(+), 24 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 7fd39dc..5a91d27 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -1101,28 +1101,7 @@ sub ModReserve { > > my $dbh = C4::Context->dbh; > if ( $rank eq "del" ) { >- my $query = " >- UPDATE reserves >- SET cancellationdate=now() >- WHERE reserve_id = ? >- "; >- my $sth = $dbh->prepare($query); >- $sth->execute( $reserve_id ); >- $query = " >- INSERT INTO old_reserves >- SELECT * >- FROM reserves >- WHERE reserve_id = ? >- "; >- $sth = $dbh->prepare($query); >- $sth->execute( $reserve_id ); >- $query = " >- DELETE FROM reserves >- WHERE reserve_id = ? >- "; >- $sth = $dbh->prepare($query); >- $sth->execute( $reserve_id ); >- >+ CancelReserve({ reserve_id => $reserve_id }); > } > elsif ($rank =~ /^\d+/ and $rank > 0) { > my $query = " >diff --git a/t/db_dependent/Holds.t b/t/db_dependent/Holds.t >index b22f5a1..2c28c07 100755 >--- a/t/db_dependent/Holds.t >+++ b/t/db_dependent/Holds.t >@@ -6,7 +6,7 @@ use t::lib::Mocks; > use C4::Context; > use C4::Branch; > >-use Test::More tests => 23; >+use Test::More tests => 25; > use MARC::Record; > use C4::Biblio; > use C4::Items; >@@ -253,8 +253,30 @@ my $reserveid2 = C4::Reserves::GetReserveId( > CancelReserve({ reserve_id => $reserveid1 }); > > $reserve2 = GetReserve( $reserveid2 ); >-is( $reserve2->{priority}, 1, "After cancelreserve, the 2nd reserve become the first on the waiting list" ); >+is( $reserve2->{priority}, 1, "After cancelreserve, the 2nd reserve becomes the first on the waiting list" ); > >+($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => 'CPL', holdingbranch => 'CPL' } , $bibnum); >+AddReserve( >+ $branch, >+ $borrowernumbers[0], >+ $bibnum, >+ 'a', >+ '', >+ 2, >+); >+my $reserveid3 = C4::Reserves::GetReserveId( >+ { >+ biblionumber => $bibnum, >+ borrowernumber => $borrowernumbers[0] >+ } >+); >+ >+my $reserve3 = GetReserve( $reserveid3 ); >+is( $reserve3->{priority}, 2, "New reserve for patron 0, the reserve has a priority = 2" ); >+ >+ModReserve({ reserve_id => $reserveid2, rank => 'del' }); >+$reserve3 = GetReserve( $reserveid3 ); >+is( $reserve3->{priority}, 1, "After ModReserve, the 3rd reserve becomes the first on the waiting list" ); > > > # Helper method to set up a Biblio. >-- >1.7.10.4
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 11336
:
23286
|
23384
|
23522
|
23531
|
23532
|
23567
|
23629
|
23706
|
23707
|
23721
|
23787
|
23831
|
23862
|
23863