Bugzilla – Attachment 63595 Details for
Bug 11999
Add two checks in CanBookBeReserved and CanItemBeReserved
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11999: Remove 'alreadyReserved' check in CanBookBeReserved
Bug-11999-Remove-alreadyReserved-check-in-CanBookB.patch (text/plain), 2.03 KB, created by
Julian Maurice
on 2017-05-22 07:10:33 UTC
(
hide
)
Description:
Bug 11999: Remove 'alreadyReserved' check in CanBookBeReserved
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2017-05-22 07:10:33 UTC
Size:
2.03 KB
patch
obsolete
>From 24d05dd5fd97b137a967a2bdd686155dadf61f0c Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Tue, 10 Jan 2017 13:20:02 +0100 >Subject: [PATCH] Bug 11999: Remove 'alreadyReserved' check in > CanBookBeReserved > >Since bug 14695 it is possible to reserve more than one item per biblio > >Also fix bad use of $item >--- > C4/Reserves.pm | 9 +-------- > t/db_dependent/Holds.t | 4 ++-- > 2 files changed, 3 insertions(+), 10 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 97b55f6731..5d2c318967 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -325,15 +325,8 @@ See CanItemBeReserved() for possible return values. > sub CanBookBeReserved{ > my ($borrowernumber, $biblionumber) = @_; > >- # Check if borrower already has reserved the same biblio. >- my @reserves = GetReservesFromBorrowernumber($borrowernumber); >- foreach my $reserve (@reserves) { >- if ($reserve->{biblionumber} == $biblionumber) { >- return 'alreadyReserved'; >- } >- } >- > # Check if borrower has reached the maximum number of holds allowed >+ my @reserves = GetReservesFromBorrowernumber($borrowernumber); > my $maxreserves = C4::Context->preference('maxreserves'); > if ($maxreserves && scalar(@reserves) >= $maxreserves) { > return 'tooManyReserves'; >diff --git a/t/db_dependent/Holds.t b/t/db_dependent/Holds.t >index 06e702967d..ffcf66b5d8 100755 >--- a/t/db_dependent/Holds.t >+++ b/t/db_dependent/Holds.t >@@ -397,10 +397,10 @@ ok( > "cannot request item if policy that matches on bib-level item type forbids it (bug 9532)" > ); > >-is(CanBookBeReserved($borrowernumbers[0], $bibnum), 'alreadyReserved'); >+is(CanBookBeReserved($borrowernumbers[0], $bibnum), 'none_available'); > > C4::Context->set_preference('maxreserves', 1); >-ok(CanBookBeReserved($borrowernumbers[0], $biblionumber) eq 'tooManyReserves'); >+is(CanBookBeReserved($borrowernumbers[0], $biblionumber), 'tooManyReserves'); > > C4::Context->set_preference('maxreserves', 0); > t::lib::Mocks::mock_preference('IndependentBranches', 1); >-- >2.11.0
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 11999
:
26589
|
28986
|
31524
|
35697
|
36358
|
36404
|
36630
|
38397
|
41951
|
41952
|
44631
|
44632
|
46262
|
46263
|
50224
|
50225
|
58741
|
58742
|
58743
|
63593
|
63594
|
63595
|
66267
|
66268
|
66269
|
66270
|
88300
|
88301
|
88302
|
88303
|
90142
|
90143
|
90144
|
90146
|
90147
|
91046
|
91402
|
91403
|
91479
|
91481
|
91494
|
91580
|
91581
|
91582
|
91590
|
91591
|
91592
|
91593
|
99927
|
99928
|
106481
|
106494
|
111687
|
111688
|
111689
|
112871
|
112872
|
112873
|
112874
|
120776
|
120777
|
120778
|
120779
|
120780
|
121531
|
121612