[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
Thu May 2 12:58:27 CEST 2019


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

Martin Renvoize <martin.renvoize at ptfs-europe.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #89150|0                           |1
        is obsolete|                            |

--- Comment #4 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
Created attachment 89220
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=89220&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>

Signed-off-by: Liz Rea <wizzyrea at gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

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


More information about the Koha-bugs mailing list