From 2fd0a85858dc0ace14a5e4478a08c0411f8d0ddf Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 26 Apr 2019 10:19:07 -0300 Subject: [PATCH] Bug 15496: (QA follow-up) Restore Koha::Biblio->items broken by rebase This patch restores the implementation introduced by 22701. Signed-off-by: Tomas Cohen Arazi --- Koha/Biblio.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm index 688edc85ae..9591553951 100644 --- a/Koha/Biblio.pm +++ b/Koha/Biblio.pm @@ -350,9 +350,11 @@ sub article_requests_finished { =head3 items +my @items = $biblio->items(); my $items = $biblio->items(); -Returns the related Koha::Items object for this biblio +Returns the related Koha::Items object for this biblio in scalar context, +or list of Koha::Item objects in list context. =cut @@ -361,9 +363,13 @@ sub items { my $items_rs = $self->_result->items; - return Koha::Items->_new_from_dbic( $items_rs ); + return + wantarray + ? Koha::Items->_new_from_dbic($items_rs)->as_list + : Koha::Items->_new_from_dbic($items_rs); } + =head3 itemtype my $itemtype = $biblio->itemtype(); -- 2.21.0