Bugzilla – Attachment 55745 Details for
Bug 17327
Item level holds no longer enforced
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17327 - Item level holds no longer enforced
Bug-17327---Item-level-holds-no-longer-enforced.patch (text/plain), 2.14 KB, created by
Kyle M Hall (khall)
on 2016-09-21 21:41:08 UTC
(
hide
)
Description:
Bug 17327 - Item level holds no longer enforced
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2016-09-21 21:41:08 UTC
Size:
2.14 KB
patch
obsolete
>From 69c4a7c98afe878561a9bf045779b8af70be56da Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 21 Sep 2016 02:15:02 +0000 >Subject: [PATCH] Bug 17327 - Item level holds no longer enforced > >Reported by Katrin: > >Example: >- on shelf holds allowed >- holds allowed 5 >- holds on same record allowed 5 >- FORCE item level holds > >On a record with only one item, you can only place a record level hold >in OPAC now - which is against your circulation conditions. > >Another example: >- record with 2 items >- circulation rules as above, 1 hold allowed on the record >- Item level holds: forced > >I can only place record level holds in OPAC and staff. At the moment, I >am not able to place item level holds in any circumstances in my >installation. > >Test Plan: >1) Apply the unit test patch >2) prove t/db_dependent/Reserves/MultiplePerRecord.t > should fail >3) Apply the second patch >4) prove t/db_dependent/Reserves/MultiplePerRecord.t > should pass >5) Attempt to replicate one of the examples above, you should be unable to >--- > Koha/Holds.pm | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > >diff --git a/Koha/Holds.pm b/Koha/Holds.pm >index bde63c9..6dc0c9e 100644 >--- a/Koha/Holds.pm >+++ b/Koha/Holds.pm >@@ -62,7 +62,7 @@ This method will return 'item' if the patron has > at least one item level hold. It will return 'record' > if the patron has holds but none are item level, > Finally, if the patron has no holds, it will return >-undef which indicateds the patron may select either >+undef which indicates the patron may select either > record or item level holds, barring any other rules > that would prevent one or the other. > >@@ -71,9 +71,13 @@ that would prevent one or the other. > sub forced_hold_level { > my ($self) = @_; > >- return $self->search( { itemnumber => { '!=' => undef } } )->count() >- ? 'item' >- : 'record'; >+ my $item_level_count = $self->search( { itemnumber => { '!=' => undef } } )->count(); >+ return 'item' if $item_level_count > 0; >+ >+ my $record_level_count = $self->search( { itemnumber => undef } )->count(); >+ return 'record' if $record_level_count > 0; >+ >+ return undef; > } > > =head3 type >-- >2.1.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 17327
:
55744
|
55745
|
55761
|
55762
|
55825
|
55826
|
55827