Bugzilla – Attachment 190855 Details for
Bug 41510
Fallback on bookable itemtype can break if item has no itemtype
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41510: Handle undefined itemtype in item->effective_bookable
Bug-41510-Handle-undefined-itemtype-in-item-effect.patch (text/plain), 1011 bytes, created by
David Nind
on 2026-01-03 02:48:07 UTC
(
hide
)
Description:
Bug 41510: Handle undefined itemtype in item->effective_bookable
Filename:
MIME Type:
Creator:
David Nind
Created:
2026-01-03 02:48:07 UTC
Size:
1011 bytes
patch
obsolete
>From 5c223409fd0df99138125e81bda23f4d3509c02c Mon Sep 17 00:00:00 2001 >From: Paul Derscheid <paul.derscheid@lmscloud.de> >Date: Fri, 2 Jan 2026 11:22:46 +0100 >Subject: [PATCH] Bug 41510: Handle undefined itemtype in > item->effective_bookable > >- Guard against undefined itemtype before calling ->bookable on it >- Return 0 (not bookable) when no itemtype is found and item-level > bookable is not defined > >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/Item.pm | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/Koha/Item.pm b/Koha/Item.pm >index d2b92c1956..9ebfe6c817 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -2066,7 +2066,9 @@ Returns the effective bookability of the current item, be that item or itemtype > sub effective_bookable { > my ($self) = @_; > >- return $self->bookable // $self->itemtype->bookable; >+ return $self->bookable if defined $self->bookable; >+ return $self->itemtype->bookable if $self->itemtype; >+ return 0; > } > > =head3 orders >-- >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 41510
:
190820
|
190821
|
190854
| 190855