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>