Bugzilla – Attachment 23706 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]
[PASSED QA] Bug 11336: Priority is not updated on deleting holds
PASSED-QA-Bug-11336-Priority-is-not-updated-on-del.patch (text/plain), 3.40 KB, created by
Katrin Fischer
on 2013-12-20 06:49:08 UTC
(
hide
)
Description:
[PASSED QA] Bug 11336: Priority is not updated on deleting holds
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2013-12-20 06:49:08 UTC
Size:
3.40 KB
patch
obsolete
>From 9f5d5792aba1f9926224a885c5ea94832afe1749 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Fri, 13 Dec 2013 17:42:55 +0100 >Subject: [PATCH] [PASSED QA] Bug 11336: Priority is not updated on deleting > holds > >There are a lot of places where a hold deletion is possible. But I just found >1 place where it works! > >To reproduce: >- select or create 2 users U1 and U2 >- select or create an holdable item >- place on hold for both U1 and U2. U1 has priority 1 and U2 has priority 2. >- delete the hold for U1 >- go on circ/circulation.pl?borrowernumber=XXXX for U2 (or in the DB directly) and >verify the priority has not been set to 1 > >The issue is repeatable (at least) on these 2 pages: > * circ/circulation.pl?borrowernumber=XXXX (tab 'Holds', select "yes" in the >dropdown list and submit the form) > * reserve/request.pl?biblionumber=XXXX (clic on the red cross) > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >Testing notes on second patch. >--- > C4/Reserves.pm | 9 +++++++++ > t/db_dependent/Holds.t | 48 +++++++++++++++++++++++++++++++++++++++++++++--- > 2 files changed, 54 insertions(+), 3 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index d1bca25..7fd39dc 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -252,6 +252,8 @@ sub AddReserve { > > $res = GetReserve( $reserve_id ); > >+ Return the current reserve or the old reserve. >+ > =cut > > sub GetReserve { >@@ -262,6 +264,13 @@ sub GetReserve { > my $sth = $dbh->prepare( $query ); > $sth->execute( $reserve_id ); > my $res = $sth->fetchrow_hashref(); >+ >+ unless ( $res ) { >+ $res = $dbh->selectrow_hashref(q| >+ SELECT * FROM old_reserves WHERE reserve_id = ? >+ |, {}, $reserve_id); >+ } >+ > return $res; > } > >diff --git a/t/db_dependent/Holds.t b/t/db_dependent/Holds.t >index 74cecfa..b22f5a1 100755 >--- a/t/db_dependent/Holds.t >+++ b/t/db_dependent/Holds.t >@@ -1,13 +1,12 @@ > #!/usr/bin/perl > >-use strict; >-use warnings; >+use Modern::Perl; > > use t::lib::Mocks; > use C4::Context; > use C4::Branch; > >-use Test::More tests => 22; >+use Test::More tests => 23; > use MARC::Record; > use C4::Biblio; > use C4::Items; >@@ -215,6 +214,49 @@ ok( > '... unless canreservefromotherbranches is ON (bug 2394)' > ); > >+# Regression test for bug 11336 >+($bibnum, $title, $bibitemnum) = create_helper_biblio(); >+my ( $hold1, $hold2 ); >+($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => 'CPL', holdingbranch => 'CPL' } , $bibnum); >+AddReserve( >+ $branch, >+ $borrowernumbers[0], >+ $bibnum, >+ 'a', >+ '', >+ 1, >+); >+ >+my $reserveid1 = C4::Reserves::GetReserveId( >+ { >+ biblionumber => $bibnum, >+ borrowernumber => $borrowernumbers[0] >+ } >+); >+ >+($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => 'CPL', holdingbranch => 'CPL' } , $bibnum); >+AddReserve( >+ $branch, >+ $borrowernumbers[1], >+ $bibnum, >+ 'a', >+ '', >+ 2, >+); >+my $reserveid2 = C4::Reserves::GetReserveId( >+ { >+ biblionumber => $bibnum, >+ borrowernumber => $borrowernumbers[1] >+ } >+); >+ >+CancelReserve({ reserve_id => $reserveid1 }); >+ >+$reserve2 = GetReserve( $reserveid2 ); >+is( $reserve2->{priority}, 1, "After cancelreserve, the 2nd reserve become the first on the waiting list" ); >+ >+ >+ > # Helper method to set up a Biblio. > sub create_helper_biblio { > my $bib = MARC::Record->new(); >-- >1.8.3.2
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