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.
Created attachment 66620 [details] [review] 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
Created attachment 66627 [details] [review] 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>
Created attachment 66631 [details] [review] 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>
Created attachment 66632 [details] [review] 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>
Created attachment 66633 [details] [review] Bug 19209 [Followup] - Ensure checkouts don't prevent deleting patrons Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(In reply to Kyle M Hall from comment #5) > Created attachment 66633 [details] [review] [review] > Bug 19209 [Followup] - Ensure checkouts don't prevent deleting patrons > > Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Thanks for the followup!
QA: Looking here now
Created attachment 66683 [details] [review] 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>
Created attachment 66684 [details] [review] 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>
Created attachment 66685 [details] [review] 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>
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.
(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.
Pushed to master for 17.11, thanks to everybody involved!
Enhancement not pushed to 17.05.x