[Koha-bugs] [Bug 17820] Do not use search->next when find can be used

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Dec 29 11:42:26 CET 2016


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

Marcel de Rooy <m.de.rooy at rijksmuseum.nl> changed:

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

--- Comment #2 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
Created attachment 58487
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58487&action=edit
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 at rijksmuseum.nl>
Tested by enabling TrackLastPatronActivity and logging in again.
Verified lastseen column in borrowers.

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


More information about the Koha-bugs mailing list