]> git.koha-community.org Git - koha.git/commit
Bug 27071: (follow-up) Get rid of loop
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 22 Feb 2021 12:27:12 +0000 (09:27 -0300)
committerAndrew Fuerste-Henry <andrew@bywatersolutions.com>
Fri, 5 Mar 2021 17:59:40 +0000 (17:59 +0000)
commit1ed05f85a03e43d87a7b1a4603b252ed7b3a769e
tree51733b7ff587f81aea0ed9ade4d920989d2925e6
parent419d01c2a73370ef7d35e7c099615be0fe400461
Bug 27071: (follow-up) Get rid of loop

This patch gets rid of a loop on the librarary's groups siblings, and
acknowledges ->get_hold_libraries returns a proper Koha::Libraries
iterator that can be chained with a new query on the passed branchcode.
This way we only fetch  a count from the DB and no loop needs to take
place on the code.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Libraries.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3495a7e9af70706e3ebba60e3fac7aa3845d1d78)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3525fc03c6d6bb7dbb3e0d49ac8e68444839e82b)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Koha/Library.pm