]> git.koha-community.org Git - koha.git/commit
Bug 22813: remove repetitive queries inside two nested loops in searchResults
authorTomas Cohen Arazi <tomascohen@theke.io>
Tue, 30 Apr 2019 15:30:25 +0000 (12:30 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 8 May 2019 15:36:22 +0000 (16:36 +0100)
commit738aafb92dcfb73f51f9302fa9506040a8cc2930
treea1b474cabd35e482c7d5f0ce085847cda676b2d4
parent540542ebc4befc9150be287c48be2d9c11129f72
Bug 22813: remove repetitive queries inside two nested loops in searchResults

This patch moves a query on Koha::Patrons and then the related
Koha::Patron::Category that needlessly happens inside two nested loops
(all items of all MARC records in the resultset).

The Koha::Patron and Koha::Patron::Category are always the same as it is
fetched from C4::Context->userenv each time.

To test:
- Run:
  $ kshell
 k$ prove t/db_dependent/Search.t
=> SUCCESS: Tests pass
- Apply this patch
- Run:
 k$ prove t/db_dependent/Search.t
=> SUCCESS: Tests still pass!
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 10efe4e3f239c47b847c53f06f82245e07d54759)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
C4/Search.pm