Bugzilla – Attachment 75608 Details for
Bug 20825
Cannot checkout if item types at biblio level
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20825: (bug 19943 follow-up) call notforloan on itemtype instead of biblioitem
Bug-20825-bug-19943-follow-up-call-notforloan-on-i.patch (text/plain), 2.26 KB, created by
Katrin Fischer
on 2018-05-28 20:08:43 UTC
(
hide
)
Description:
Bug 20825: (bug 19943 follow-up) call notforloan on itemtype instead of biblioitem
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2018-05-28 20:08:43 UTC
Size:
2.26 KB
patch
obsolete
>From 8af9e68e9bb84a4fd800eb10756acae33671f7d6 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 28 May 2018 11:24:43 -0300 >Subject: [PATCH] Bug 20825: (bug 19943 follow-up) call notforloan on itemtype > instead of biblioitem > >On bug 19943: > - elsif ($biblioitem->{'notforloan'} == 1){ > + elsif ($biblioitem->notforloan == 1){ > >The biblioitems table does not contain a notforloan column, this comes >from the item type. > >This bug only appears when item type is defined at biblio level >(item-level_itypes=0) > >Test plan: >Set item-level_itypes = biblio >Check an item out > >Without this patch it explodes with >"The method notforloan is not covered by tests!" > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >I reproduced the error condition and verified the tests failed without >this patch. After this patch is applied, tests pass and checkout >succeeds. > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > C4/Circulation.pm | 17 ++++++++++------- > 1 file changed, 10 insertions(+), 7 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 2deb367..7bd789c 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -929,13 +929,16 @@ sub CanBookBeIssued { > } > } > } >- elsif ($biblioitem->notforloan == 1){ >- if (!C4::Context->preference("AllowNotForLoanOverride")) { >- $issuingimpossible{NOT_FOR_LOAN} = 1; >- $issuingimpossible{itemtype_notforloan} = $effective_itemtype; >- } else { >- $needsconfirmation{NOT_FOR_LOAN_FORCING} = 1; >- $needsconfirmation{itemtype_notforloan} = $effective_itemtype; >+ else { >+ my $itemtype = Koha::ItemTypes->find($biblioitem->itemtype); >+ if ( $itemtype and $itemtype->notforloan == 1){ >+ if (!C4::Context->preference("AllowNotForLoanOverride")) { >+ $issuingimpossible{NOT_FOR_LOAN} = 1; >+ $issuingimpossible{itemtype_notforloan} = $effective_itemtype; >+ } else { >+ $needsconfirmation{NOT_FOR_LOAN_FORCING} = 1; >+ $needsconfirmation{itemtype_notforloan} = $effective_itemtype; >+ } > } > } > } >-- >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 20825
:
75575
|
75576
|
75578
|
75579
|
75580
|
75591
|
75592
|
75595
|
75596
|
75605
|
75606
|
75607
| 75608 |
75639