From b0574a0062089a58299d570e93012823f873b273 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 Signed-off-by: Kyle M Hall Signed-off-by: Marcel de Rooy Signed-off-by: Nick Clemens Signed-off-by: Martin Renvoize --- 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.39.5