From 327cb59546bb5605b99871d086823fa10a9ba6ef Mon Sep 17 00:00:00 2001 From: Paul Derscheid 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 Signed-off-by: Martin Renvoize (cherry picked from commit 99410bc27c365472ac1a74521042ae00551efcd1) Signed-off-by: Jacob O'Mara Signed-off-by: Wainui Witika-Park --- Koha/Item.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Koha/Item.pm b/Koha/Item.pm index 648268a327..4d81919e12 100644 --- a/Koha/Item.pm +++ b/Koha/Item.pm @@ -2067,7 +2067,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