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>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
(cherry picked from commit 99410bc27c)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
This commit is contained in:
Paul Derscheid 2026-01-02 11:22:46 +01:00 committed by Wainui Witika-Park
parent 00457f7e73
commit 327cb59546
No known key found for this signature in database
GPG Key ID: 2D0A6AB5DAF1B78D
1 changed files with 3 additions and 1 deletions

View File

@ -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