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:
parent
00457f7e73
commit
327cb59546
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue