Bugzilla – Attachment 145795 Details for
Bug 32129
Use patron categorycode of most relevant recall when checking if item can be a waiting recall
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32129: Use patron category when checking if item can fill recall
Bug-32129-Use-patron-category-when-checking-if-ite.patch (text/plain), 3.49 KB, created by
David Nind
on 2023-01-30 07:48:24 UTC
(
hide
)
Description:
Bug 32129: Use patron category when checking if item can fill recall
Filename:
MIME Type:
Creator:
David Nind
Created:
2023-01-30 07:48:24 UTC
Size:
3.49 KB
patch
obsolete
>From af073185b13d38300c266105d891d4aab7fed028 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Tue, 8 Nov 2022 19:58:22 +0000 >Subject: [PATCH] Bug 32129: Use patron category when checking if item can fill > recall > >This patch uses the patron category of the patron who requested the most >relevant recall to check for more specific circulation rules relating to >recalls. This ensures that patrons who are allowed to place recalls are >able to fill their recalls, especially when recalls are not generally >available for all patron categories. > >To test: >1) Go to Administration -> System preferences and enable UseRecalls >2) Go to Administration -> Circulation and fines rules and set a general >All/All rule and a Category A/Itemtype A rule. All values can be set >however you like except for these recalls rules: > >All/All rule: >Recalls allowed: 0 >Recalls per record: 0 >On shelf recalls allowed: if any unavailable > >Category A/Itemtype A rule: >Recalls allowed: 5 >Recalls per record: 5 >On shelf recalls allowed: if any unavailable > >3) Find an item of Itemtype A. Check it out to Patron A (any category). >4) Log into the OPAC as Patron B (of Category A). Find the item and >place a recall on the item. >5) Back in the staff interface, check in the item. This should trigger >the recalls process so you can allocate the item to Patron B's recall, >however the pop-up box to confirm the recall does not show. This is the >bug. > >6) Apply the patch and restart services > >7) Check in the item again. Confirm the pop-up box to confirm the recall >shows and you are able to allocate the item to Patron B's recall. >8) Confirm tests pass t/db_dependent/Koha/Item.t > >Sponsored-by: Auckland University of Technology >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/Item.pm | 2 +- > t/db_dependent/Koha/Item.t | 8 ++++---- > 2 files changed, 5 insertions(+), 5 deletions(-) > >diff --git a/Koha/Item.pm b/Koha/Item.pm >index dae9df8f29..56e2160d8f 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -1955,7 +1955,7 @@ sub can_be_waiting_recall { > # Check the circulation rule for each relevant itemtype for this item > my $rule = Koha::CirculationRules->get_effective_rules({ > branchcode => $branchcode, >- categorycode => undef, >+ categorycode => $self->check_recalls ? $self->check_recalls->patron->categorycode : undef, > itemtype => $self->effective_itemtype, > rules => [ > 'recalls_allowed', >diff --git a/t/db_dependent/Koha/Item.t b/t/db_dependent/Koha/Item.t >index 04d7465e79..48833c2a10 100755 >--- a/t/db_dependent/Koha/Item.t >+++ b/t/db_dependent/Koha/Item.t >@@ -1705,8 +1705,8 @@ subtest 'Recalls tests' => sub { > # Patron2 has Item1 checked out. Patron1 has placed a biblio-level recall on Biblio1, so check if Item1 can fulfill Patron1's recall. > > Koha::CirculationRules->set_rules({ >- branchcode => undef, >- categorycode => undef, >+ branchcode => $branchcode, >+ categorycode => $patron1->categorycode, > itemtype => $item1->effective_itemtype, > rules => { > recalls_allowed => 0, >@@ -1717,8 +1717,8 @@ subtest 'Recalls tests' => sub { > is( $item1->can_be_waiting_recall, 0, "Recalls not allowed for this itemtype" ); > > Koha::CirculationRules->set_rules({ >- branchcode => undef, >- categorycode => undef, >+ branchcode => $branchcode, >+ categorycode => $patron1->categorycode, > itemtype => $item1->effective_itemtype, > rules => { > recalls_allowed => 1, >-- >2.30.2
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 32129
:
143449
|
145795
|
147529
|
151160