Bug 29702: Fetch group libraries in a single call
[srvgit] / Koha / Library / Group.pm
index aaf6853..ea9ed13 100644 (file)
@@ -144,14 +144,10 @@ sub all_libraries {
 
     my @libraries;
 
-    my @children = $self->children;
+    push (@libraries, $self->libraries);
+    my @children = $self->children->search({ branchcode => undef });
     foreach my $c (@children) {
-        if ( $c->branchcode ) {
-            push( @libraries, $c->library );
-        }
-        else {
-            push( @libraries, $c->all_libraries );
-        }
+        push( @libraries, $c->all_libraries );
     }
 
     my %seen;