From dc48661d0543153afd535442ca7c4a8ebda04592 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 30 May 2018 14:53:28 -0300 Subject: [PATCH] Bug 20838: Make Koha::Library::Group->all_libraries return a list of Koha::Libraries Instead of a list of Koha::Library::Group Ideally it should be a Koh::Libraries iterator --- Koha/Library/Group.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Koha/Library/Group.pm b/Koha/Library/Group.pm index a54e5b1a60..cf40330545 100644 --- a/Koha/Library/Group.pm +++ b/Koha/Library/Group.pm @@ -148,7 +148,7 @@ sub all_libraries { my @children = $self->children; foreach my $c (@children) { if ( $c->branchcode ) { - push( @libraries, $c ); + push( @libraries, $c->library ); } else { push( @libraries, $c->all_libraries ); @@ -159,7 +159,6 @@ sub all_libraries { @libraries = grep { !$seen{ $_->id }++ } @libraries; -# return wantarray ? @li : $children; return @libraries; } -- 2.11.0