Bugzilla – Attachment 173185 Details for
Bug 38148
Check value of holdallowed circ rule properly (Bug 29087 follow-up)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38148: (QA follow-up) Code comments
Bug-38148-QA-follow-up-Code-comments.patch (text/plain), 2.33 KB, created by
Nick Clemens (kidclamp)
on 2024-10-22 20:08:54 UTC
(
hide
)
Description:
Bug 38148: (QA follow-up) Code comments
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-10-22 20:08:54 UTC
Size:
2.33 KB
patch
obsolete
>From bd753caa9044f55d80c1ab54b47e096b2a03c164 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 22 Oct 2024 20:06:01 +0000 >Subject: [PATCH] Bug 38148: (QA follow-up) Code comments > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > Koha/Items.pm | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > >diff --git a/Koha/Items.pm b/Koha/Items.pm >index dd8d6c47cfa..f9467117cd4 100644 >--- a/Koha/Items.pm >+++ b/Koha/Items.pm >@@ -51,7 +51,10 @@ Koha::Items - Koha Item object set class > > my $filtered_items = $items->filter_by_for_hold; > >-Return the items of the set that are *potentially* holdable. >+Return the items of the set that are *potentially* holdable. This routine >+checks only rules defined in the 'Standard rules for all libraries' and >+should only be used in the context where we don't have a patron to check >+policies for specifically. > > Caller has the responsibility to call C4::Reserves::CanItemBeReserved before > placing a hold on one of those items. >@@ -68,6 +71,7 @@ sub filter_by_for_hold { > ); > my @hold_not_allowed_itypes; > if ( defined $default_rule && $default_rule->rule_value eq 'not_allowed' ) { >+ # If the default rule is not allowed we get all itemtypes as not allowed > @hold_not_allowed_itypes = Koha::ItemTypes->search->get_column('itemtype'); > my @hold_allowed_itypes = Koha::CirculationRules->search( > { >@@ -77,8 +81,10 @@ sub filter_by_for_hold { > categorycode => undef, > } > )->get_column('itemtype'); >+ # We then only allow those explicitly defined in hold policies at the all libraries level > @hold_not_allowed_itypes = array_minus( @hold_not_allowed_itypes, @hold_allowed_itypes ); > } else { >+ # If there is no default 'not_allowed' rule, then only those explicitly forbidden at the all libraries level are forbidden > @hold_not_allowed_itypes = Koha::CirculationRules->search( > { > rule_name => 'holdallowed', >@@ -89,6 +95,7 @@ sub filter_by_for_hold { > )->get_column('itemtype'); > } > >+ # We also forbid holds on any marked not for loan at the item level > push @hold_not_allowed_itypes, Koha::ItemTypes->search({ notforloan => 1 })->get_column('itemtype'); > @hold_not_allowed_itypes = uniq @hold_not_allowed_itypes; > >-- >2.39.5
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 38148
:
172680
|
172681
|
172929
|
173125
|
173141
|
173142
|
173143
|
173144
|
173169
|
173170
|
173183
|
173184
|
173185
|
173205
|
173206
|
173207
|
173208