]> git.koha-community.org Git - koha.git/commit
Bug 17820: use ->find instead of search->next
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 28 Dec 2016 12:14:06 +0000 (13:14 +0100)
committerKatrin Fischer <katrin.fischer.83@web.de>
Wed, 4 Jan 2017 21:54:55 +0000 (22:54 +0100)
commit9e6108965aff24d4d59496b6f5137e241e5e7e3e
tree4bcc6388b94dddc2984ccfd8d7b00296bdce9a44
parentc1768e08cd82c8d2eaa9ac667004b8ad6ab36faf
Bug 17820: use ->find instead of search->next

From C4::Auth:
  my $patron = Koha::Patrons->search({ userid => $userid })->next;

This should be replaced with
  my $patron = Koha::Patrons->find({ userid => $userid });

userid is a unique key

Caught with NYTProf:
 # spent 78.9ms making 1 call to Koha::Objects::next

Test plan:
Login at the intranet
Reload the page
=> You must still be logged in

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested by enabling TrackLastPatronActivity and logging in again.
Verified lastseen column in borrowers.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit af171f9b21da8fa1c22754caa541e826ffeee529)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
C4/Auth.pm