Bugzilla – Attachment 190821 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), 964 bytes, created by
Paul Derscheid
on 2026-01-02 10:23:56 UTC
(
hide
)
Description:
Bug 41510: Handle undefined itemtype in item->effective_bookable
Filename:
MIME Type:
Creator:
Paul Derscheid
Created:
2026-01-02 10:23:56 UTC
Size:
964 bytes
patch
obsolete
>From 0fcacf5acd6ef671d8c4cbff68217f7e7720cc62 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 >--- > Koha/Item.pm | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/Koha/Item.pm b/Koha/Item.pm >index d2b92c19568..9ebfe6c817f 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.52.0
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