Summary: | Do not use search->next when find can be used | ||
---|---|---|---|
Product: | Koha | Reporter: | Jonathan Druart <jonathan.druart> |
Component: | Architecture, internals, and plumbing | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Marcel de Rooy <m.de.rooy> |
Severity: | normal | ||
Priority: | P5 - low | CC: | kyle, m.de.rooy |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | 16276 | ||
Bug Blocks: | 17819 | ||
Attachments: |
Bug 17820: use ->find instead of search->next
Bug 17820: use ->find instead of search->next |
Description
Jonathan Druart
2016-12-28 13:31:04 UTC
Created attachment 58466 [details] [review] 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 Created attachment 58487 [details] [review] 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. Passing QA on this trivial patch in one run. Works fine. Pushed to master for 17.05, thanks Jonathan! This patch has been pushed to 16.11.x and will be in 16.11.02. |