[Bug 17820] New: Do not use search->next when find can be used
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17820 Bug ID: 17820 Summary: Do not use search->next when find can be used Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: ASSIGNED Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: jonathan.druart@bugs.koha-community.org Reporter: jonathan.druart@bugs.koha-community.org QA Contact: testopia@bugs.koha-community.org Depends on: 16276
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 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16276 [Bug 16276] When automatically deleting expired borrowers, make sure they didn't log in recently -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17820 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17820 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 58466 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58466&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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17820 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |17819 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17819 [Bug 17819] Performance 16.11 - Omnibus -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17820 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17820 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #58466|0 |1 is obsolete| | --- Comment #2 from Marcel de Rooy <m.de.rooy@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@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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17820 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |master CC| |m.de.rooy@rijksmuseum.nl Status|Signed Off |Passed QA QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | --- Comment #3 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Passing QA on this trivial patch in one run. Works fine. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17820 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |kyle@bywatersolutions.com --- Comment #4 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to master for 17.05, thanks Jonathan! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17820 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |katrin.fischer@bsz-bw.de --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- This patch has been pushed to 16.11.x and will be in 16.11.02. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org