[Bug 19209] New: Koha::Objects should provide ->is_paged method
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19209 Bug ID: 19209 Summary: Koha::Objects should provide ->is_paged method Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org It is already implemented by DBIC resultsets and it should be a tiny addition to AUTOLOAD. It would save several lines of coding when pagination is used. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19209 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19209 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 66620 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=66620&action=edit Bug 19209: Add ->is_paged method to Koha::Objects This patch adds ->is_paged to Koha::Objects. It is inherited from the underlying resultset from DBIC so there's no code besides adding it to the known methods in AUTOLOAD. Tests are added for the newly exported method. To test: - Apply this patch - Run: $ sudo koha-shell kohadev k$ cd kohaclone k$ prove t/db_dependent/Koha/Objects.t => SUCCESS: Tests pass! - Sign off :-D Sponsored-by: Camden County -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19209 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | CC| |jonathan.druart@bugs.koha-c | |ommunity.org -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19209 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 66627 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=66627&action=edit Bug 19209: (QA followup) Improve tests This path merges the pager() test and adds search results count tests 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=19209 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19209 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |18731 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18731 [Bug 18731] REST api: Add an endpoint for acquisition orders -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19209 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=19209 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #66620|0 |1 is obsolete| | Attachment #66627|0 |1 is obsolete| | --- Comment #3 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 66631 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=66631&action=edit Bug 19209: Add ->is_paged method to Koha::Objects This patch adds ->is_paged to Koha::Objects. It is inherited from the underlying resultset from DBIC so there's no code besides adding it to the known methods in AUTOLOAD. Tests are added for the newly exported method. To test: - Apply this patch - Run: $ sudo koha-shell kohadev k$ cd kohaclone k$ prove t/db_dependent/Koha/Objects.t => SUCCESS: Tests pass! - Sign off :-D Sponsored-by: Camden County Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19209 --- Comment #4 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 66632 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=66632&action=edit Bug 19209: (QA followup) Improve tests This path merges the pager() test and adds search results count tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19209 --- Comment #5 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 66633 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=66633&action=edit Bug 19209 [Followup] - Ensure checkouts don't prevent deleting patrons Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19209 --- Comment #6 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Kyle M Hall from comment #5)
Created attachment 66633 [details] [review] Bug 19209 [Followup] - Ensure checkouts don't prevent deleting patrons
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Thanks for the followup! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19209 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #7 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- QA: Looking here now -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19209 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #66631|0 |1 is obsolete| | --- Comment #8 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 66683 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=66683&action=edit Bug 19209: Add ->is_paged method to Koha::Objects This patch adds ->is_paged to Koha::Objects. It is inherited from the underlying resultset from DBIC so there's no code besides adding it to the known methods in AUTOLOAD. Tests are added for the newly exported method. To test: - Apply this patch - Run: $ sudo koha-shell kohadev k$ cd kohaclone k$ prove t/db_dependent/Koha/Objects.t => SUCCESS: Tests pass! - Sign off :-D Sponsored-by: Camden County Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> 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=19209 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #66632|0 |1 is obsolete| | --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 66684 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=66684&action=edit Bug 19209: (QA followup) Improve tests This path merges the pager() test and adds search results count tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> 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=19209 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #66633|0 |1 is obsolete| | --- Comment #10 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 66685 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=66685&action=edit Bug 19209 [Followup] - Ensure checkouts don't prevent deleting patrons Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> 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=19209 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | Status|Signed Off |Passed QA --- Comment #11 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Small remark: + is( ref($patrons->pager), 'DBIx::Class::ResultSet::Pager', + 'Koha::Objects->pager returns a valid DBIx::Class object' ); If that is what we really want? Until now we wrapped lots of things in Koha objects. Btw: pager returns a Data::Page object for the current resultset. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19209 --- Comment #12 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Marcel de Rooy from comment #11)
Small remark:
+ is( ref($patrons->pager), 'DBIx::Class::ResultSet::Pager', + 'Koha::Objects->pager returns a valid DBIx::Class object' );
If that is what we really want? Until now we wrapped lots of things in Koha objects. Btw: pager returns a Data::Page object for the current resultset.
yeah, that looked weird, but I'm not touching it besides moving the tests into another subtsests. It is probably worth discussing and eventually filling a new bug. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19209 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #13 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 17.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19209 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Resolution|--- |FIXED Status|Pushed to Master |RESOLVED --- Comment #14 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Enhancement not pushed to 17.05.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org