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 commit99410bc27c) Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk> Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> (cherry picked from commit327cb59546) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
d524290897
commit
c4e7d5109a
|
|
@ -2027,7 +2027,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