Bugzilla – Attachment 27129 Details for
Bug 12079
CheckReserves() and _Findgroupreserve do not return reserve_id
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 12079: ensure that CheckReserves() includes reserve_id in its response
SIGNED-OFF-Bug-12079-ensure-that-CheckReserves-inc.patch (text/plain), 3.60 KB, created by
Bernardo Gonzalez Kriegel
on 2014-04-15 13:42:56 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 12079: ensure that CheckReserves() includes reserve_id in its response
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2014-04-15 13:42:56 UTC
Size:
3.60 KB
patch
obsolete
>From cafbd1d1b122b13d1f3e9b041617dd353a06bc3d Mon Sep 17 00:00:00 2001 >From: Galen Charlton <gmc@esilibrary.com> >Date: Mon, 14 Apr 2014 18:44:07 +0000 >Subject: [PATCH] [SIGNED-OFF] Bug 12079: ensure that CheckReserves() includes > reserve_id in its response > >This patch modifies _Findgroupreserve so that its one caller, >CheckReserves(), would include the reserve_id field in the >hold request it returns. > >Failure to include reserve_id in every circumstance resulted >in bug 11947. This patch is therefore a complementary fix for >that bug, but is not meant to preempt the direct fix for >that bug. > >To test: > >[1] Verify that t/db_dependent/Reserves.t passes. >[2] Verify that the following test plan taken from > the patch for bug 11947 works for this patch > *without* applying the patch for 11947: > >* have a few borrowers, say 4. >* have a biblio with a single item (you can scale this up, it should > work just the same.) >* issue the item to borrower A >* have borrowers B, C, and D place a hold on the item >* return the item, acknowledge that it'll be put aside for B. >* view the holds on the item. > >Without the patch: >* the hold priorities in the UI end up being "waiting, 2, 1" when they > should be "waiting, 1, 2". >* in the database "reserves" table, they're really "0, 2, 3" when they > should be "0, 1, 2". > >With the patch: >* the hold priorities in the UI end up being "waiting, 1, 2" >* in the database, they're "0, 1, 2" > >Signed-off-by: Galen Charlton <gmc@esilibrary.com> >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> > >Work as described. No koha-qa errors. Test pass >--- > C4/Reserves.pm | 6 ++++-- > t/db_dependent/Reserves.t | 4 +++- > 2 files changed, 7 insertions(+), 3 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index eb1ae2b..370b2c8 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -1819,7 +1819,8 @@ sub _Findgroupreserve { > reserves.priority AS priority, > reserves.timestamp AS timestamp, > biblioitems.biblioitemnumber AS biblioitemnumber, >- reserves.itemnumber AS itemnumber >+ reserves.itemnumber AS itemnumber, >+ reserves.reserve_id AS reserve_id > FROM reserves > JOIN biblioitems USING (biblionumber) > JOIN hold_fill_targets USING (biblionumber, borrowernumber) >@@ -1850,7 +1851,8 @@ sub _Findgroupreserve { > reserves.priority AS priority, > reserves.timestamp AS timestamp, > reserveconstraints.biblioitemnumber AS biblioitemnumber, >- reserves.itemnumber AS itemnumber >+ reserves.itemnumber AS itemnumber, >+ reserves.reserve_id AS reserve_id > FROM reserves > LEFT JOIN reserveconstraints ON reserves.biblionumber = reserveconstraints.biblionumber > WHERE reserves.biblionumber = ? >diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t >index 4b0058c..bd3aa60 100755 >--- a/t/db_dependent/Reserves.t >+++ b/t/db_dependent/Reserves.t >@@ -2,7 +2,7 @@ > > use Modern::Perl; > >-use Test::More tests => 31; >+use Test::More tests => 32; > use MARC::Record; > use DateTime::Duration; > >@@ -101,6 +101,8 @@ my ($status, $reserve, $all_reserves) = CheckReserves($itemnumber, $barcode); > > is($status, "Reserved", "CheckReserves Test 1"); > >+ok(exists($reserve->{reserve_id}), 'CheckReserves() include reserve_id in its response'); >+ > ($status, $reserve, $all_reserves) = CheckReserves($itemnumber); > is($status, "Reserved", "CheckReserves Test 2"); > >-- >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 12079
:
27104
|
27129
|
27257