Bugzilla – Attachment 58487 Details for
Bug 17820
Do not use search->next when find can be used
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17820: use ->find instead of search->next
Bug-17820-use--find-instead-of-search-next.patch (text/plain), 1.29 KB, created by
Marcel de Rooy
on 2016-12-29 10:42:26 UTC
(
hide
)
Description:
Bug 17820: use ->find instead of search->next
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2016-12-29 10:42:26 UTC
Size:
1.29 KB
patch
obsolete
>From 4749f196d5c35a525b20153beab51fc369f112f2 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 28 Dec 2016 13:14:06 +0100 >Subject: [PATCH] Bug 17820: use ->find instead of search->next >Content-Type: text/plain; charset=utf-8 > >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. >--- > C4/Auth.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index 6b7dc66..c3ad657 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -1185,7 +1185,7 @@ sub checkauth { > > if ( $userid ) { > # track_login also depends on pref TrackLastPatronActivity >- my $patron = Koha::Patrons->search({ userid => $userid })->next; >+ my $patron = Koha::Patrons->find({ userid => $userid }); > $patron->track_login if $patron; > } > >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17820
:
58466
| 58487