Bugzilla – Attachment 75860 Details for
Bug 20889
Items marked as not for loan can be checked out
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20889: Prevent not for loan items to be checked out
Bug-20889-Prevent-not-for-loan-items-to-be-checked.patch (text/plain), 1.67 KB, created by
Jonathan Druart
on 2018-06-06 17:26:56 UTC
(
hide
)
Description:
Bug 20889: Prevent not for loan items to be checked out
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-06-06 17:26:56 UTC
Size:
1.67 KB
patch
obsolete
>From 77786b1d60b35f69ff7ca23a2ea7760fd077fec0 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 6 Jun 2018 14:25:19 -0300 >Subject: [PATCH] Bug 20889: Prevent not for loan items to be checked out > >1. Item type defined at item level (item-level_itypes=1) >2. Mark an item type not for loan (itemtypes.notforloan=1) >3. Checkout an item using this item type (items.itype="BK" for instance) >=> Checkout is not blocked! > >I suspect > commit 3953fdb921d7f280ffbaca813956357aa67d42ca > Bug 19943: Remove itemtype vs itype confusion in CanBookBeIssued >to be the root of this issue. >One occurrence of $item->{itemtype} has not been replaced. >In this case it refers to the biblioitem->{itemtype} value whereas we want to use >$item->{itype}. So this issue does not happen if items.itype==biblioitem.itemtype >(just in case you are not reproducing the problem). > >Test plan: >Make sure not for loan items cannot be checked out >--- > C4/Circulation.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 7bd789c442..6aada15eba 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -917,7 +917,7 @@ sub CanBookBeIssued { > if (C4::Context->preference('item-level_itypes')){ > # this should probably be a subroutine > my $sth = $dbh->prepare("SELECT notforloan FROM itemtypes WHERE itemtype = ?"); >- $sth->execute($item->{'itemtype'}); >+ $sth->execute($effective_itemtype); > my $notforloan=$sth->fetchrow_hashref(); > if ($notforloan->{'notforloan'}) { > if (!C4::Context->preference("AllowNotForLoanOverride")) { >-- >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 20889
:
75859
|
75860
|
75865
|
75866
|
75876
|
75877