From 18b8e5146f9cd598d02eb34372e8310139a7b307 Mon Sep 17 00:00:00 2001 From: Andrew Isherwood Date: Fri, 12 Oct 2018 14:31:45 +0100 Subject: [PATCH] Bug 20581: (follow-up) Fix statusalias return As per https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20581#c57 --- Koha/Illrequest.pm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm index dae28f4321..71ee2d2a0f 100644 --- a/Koha/Illrequest.pm +++ b/Koha/Illrequest.pm @@ -111,15 +111,22 @@ available for request. =head3 statusalias + my $statusalias = $request->statusalias; + +Return a request's status alias, if one is defined, otherwise +return implicit undef + =cut sub statusalias { my ( $self ) = @_; - return $self->status_alias ? - Koha::AuthorisedValue->_new_from_dbic( + if ($self->status_alias) { + return Koha::AuthorisedValue->_new_from_dbic( scalar $self->_result->status_alias - ) : - undef; + ); + } else { + return; + } } =head3 illrequestattributes -- 2.11.0