Bugzilla – Attachment 92627 Details for
Bug 23404
Circulation::TooMany error on itemtype when at biblio level
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23404: fix Circulation::TooMany error on itemtype when at biblio level
Bug-23404-fix-CirculationTooMany-error-on-itemtype.patch (text/plain), 2.89 KB, created by
Kyle M Hall (khall)
on 2019-09-06 10:33:02 UTC
(
hide
)
Description:
Bug 23404: fix Circulation::TooMany error on itemtype when at biblio level
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2019-09-06 10:33:02 UTC
Size:
2.89 KB
patch
obsolete
>From b65d2fdb4480777b162bba064a8dbb46a2997f2e Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Wed, 31 Jul 2019 15:56:22 +0200 >Subject: [PATCH] Bug 23404: fix Circulation::TooMany error on itemtype when at > biblio level > >Circulation::TooMany gets itemtype from $item var beeing a Koha::Item unblessed. >When itemtype is at biblio level, calling $item->{'itemtype'} is wrong. > >Test plan : >1) On a catalog with itemtype at item level : pref item-level_itypes=1 >2) Create a biblio record with itemtype BOOK >3) Create an item on this biblio record with itemtype BOOK >4) Delete all issuing rules >5) Create a issuing rule with itemtype BOOK, any catagorie, any branch >6) Check-out the item >7) => Checkout is allowed >8) Check-in item >9) Change itemtype at biblio level : pref item-level_itypes=0 >10) Check-out the item >11) => Checkout is not allowed > You see message "No circulation rule is defined for this patron and itemtype combination" > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > C4/Circulation.pm | 13 +++++-------- > 1 file changed, 5 insertions(+), 8 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index fb798c8ba9..d4567c3a57 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -374,8 +374,7 @@ sub transferbook { > > sub TooMany { > my $borrower = shift; >- my $biblionumber = shift; >- my $item = shift; >+ my $item_object = shift; > my $params = shift; > my $onsite_checkout = $params->{onsite_checkout} || 0; > my $switch_onsite_checkout = $params->{switch_onsite_checkout} || 0; >@@ -383,11 +382,9 @@ sub TooMany { > my $dbh = C4::Context->dbh; > my $branch; > # Get which branchcode we need >- $branch = _GetCircControlBranch($item,$borrower); >- my $type = (C4::Context->preference('item-level_itypes')) >- ? $item->{'itype'} # item-level >- : $item->{'itemtype'}; # biblio-level >- >+ $branch = _GetCircControlBranch($item_object->unblessed,$borrower); >+ my $type = $item_object->effective_itemtype; >+ > # given branch, patron category, and item type, determine > # applicable issuing rule > my $maxissueqty_rule = Koha::CirculationRules->get_effective_rule( >@@ -905,7 +902,7 @@ sub CanBookBeIssued { > and $issue > and $issue->onsite_checkout > and $issue->borrowernumber == $patron->borrowernumber ? 1 : 0 ); >- my $toomany = TooMany( $patron_unblessed, $item_object->biblionumber, $item_unblessed, { onsite_checkout => $onsite_checkout, switch_onsite_checkout => $switch_onsite_checkout, } ); >+ my $toomany = TooMany( $patron_unblessed, $item_object, { onsite_checkout => $onsite_checkout, switch_onsite_checkout => $switch_onsite_checkout, } ); > # if TooMany max_allowed returns 0 the user doesn't have permission to check out this book > if ( $toomany && not exists $needsconfirmation{RENEW_ISSUE} ) { > if ( $toomany->{max_allowed} == 0 ) { >-- >2.20.1 (Apple Git-117)
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 23404
:
91891
|
91892
|
91893
|
92626
|
92627
|
92628
|
92655
|
92656
|
92657
|
92658