[Bug 18332] New: Add the Koha::Objects->last method
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18332 Bug ID: 18332 Summary: Add the Koha::Objects->last method Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: ASSIGNED Severity: enhancement 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 This is not a DBIx::Class method, but we can provide it for Koha::Objects using slice. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18332 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=18332 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 61625 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61625&action=edit Bug 18332: Add the Koha::Objects->last method DBIx::Class does not provide such method, but it can be handy in some cases. Test plan: prove t/db_dependent/Koha/Objects.t should return green -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18332 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #61625|0 |1 is obsolete| | --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 61626 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61626&action=edit Bug 18332: Add the Koha::Objects->last method DBIx::Class does not provide such method, but it can be handy in some cases. Test plan: prove t/db_dependent/Koha/Objects.t should return green -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18332 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |17964 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17964 [Bug 17964] TT syntax for notices - Prove that CHECKIN and CHECKOUT are compatible -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18332 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #61626|0 |1 is obsolete| | --- Comment #3 from Marc Véron <veron@veron.ch> --- Created attachment 61636 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61636&action=edit Bug 18332: Add the Koha::Objects->last method DBIx::Class does not provide such method, but it can be handy in some cases. Test plan: prove t/db_dependent/Koha/Objects.t should return green Test returned green. Signed-off-by: Marc Véron <veron@veron.ch> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18332 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |veron@veron.ch Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18332 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18332 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #61636|0 |1 is obsolete| | --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 61694 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61694&action=edit Bug 18332: Add the Koha::Objects->last method DBIx::Class does not provide such method, but it can be handy in some cases. Test plan: prove t/db_dependent/Koha/Objects.t should return green Test returned green. Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18332 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- + my $result = $self->_resultset->slice($count - 1, $count)->first; Why do not do this: my ( $result ) = $self->_resultset->slice($count - 1, $count - 1); Strictly speaking, you call slice with an invalid argument; since the index starts at 0, $count is past the last element. Instead of calling in scalar context and doing first, you should call in list context? Adding a follow-up. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18332 --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 61751 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61751&action=edit Bug 18332: [QA Follow-up] Adjust slice call in last method We should call slice in list context with the correct indexes. Test plan: Run t/db_dependent/Koha/Objects.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18332 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |kyle@bywatersolutions.com --- Comment #7 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to master for 17.05, thanks Jonathan, Marcel! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18332 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED CC| |katrin.fischer@bsz-bw.de Status|Pushed to Master |RESOLVED --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- This won't get ported back to 16.11.x as it is an enhancement. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org