[Koha-bugs] [Bug 22813] searchResults queries the Koha::Patron object inside two nested loops

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Apr 30 17:36:11 CEST 2019


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22813

--- Comment #1 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
Created attachment 89137
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=89137&action=edit
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 at theke.io>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list