Created attachment 90774 [details] [review] Bug 23156: Add pagination to checkouts in ILS-DI GetPatronInfo service When patrons have a lot of checkouts, GetPatronInfo can take a lot of time. This patch introduces two new parameters to allow pagination of this list of checkouts Also, fix a warning in C4::ILSDI::Services::GetPatronInfo Test plan: 1. Go to /cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=X&show_loans=1 where X is a borrowernumber of a patron who has several checkouts Verify that all checkouts are listed 2. Add '&loans_per_page=1&loans_page=1' to the URL. Verify that you have now only one checkout listed, and that there is a new element <total_loans> which contain the total number of checkouts 3. Increase the page number in the URL until you have seen all checkouts 4. prove t/db_dependent/ILSDI_Services.t
Created attachment 90812 [details] [review] Bug 23156: Add pagination to checkouts in ILS-DI GetPatronInfo service When patrons have a lot of checkouts, GetPatronInfo can take a lot of time. This patch introduces two new parameters to allow pagination of this list of checkouts Also, fix a warning in C4::ILSDI::Services::GetPatronInfo Test plan: 1. Go to /cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=X&show_loans=1 where X is a borrowernumber of a patron who has several checkouts Verify that all checkouts are listed 2. Add '&loans_per_page=1&loans_page=1' to the URL. Verify that you have now only one checkout listed, and that there is a new element <total_loans> which contain the total number of checkouts 3. Increase the page number in the URL until you have seen all checkouts 4. prove t/db_dependent/ILSDI_Services.t Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Yipee, super great! I was looking for this since a couple months but unfortunately couldn't find the time nor the expertise to do it myself. Thanks Julian for the patch!!! Thanks Mark for signing off :)
+ $per_page ||= 10; Sure about that? It's a change in the behavior. I would default to 'all'.
(In reply to Jonathan Druart from comment #4) > + $per_page ||= 10; > > Sure about that? It's a change in the behavior. I would default to 'all'. $per_page defaults to 10 only if $page is defined. If $page and $per_page are both undefined the behavior is to return all checkouts.
Indeed Julian!
Created attachment 90977 [details] [review] Bug 23156: Add pagination to checkouts in ILS-DI GetPatronInfo service When patrons have a lot of checkouts, GetPatronInfo can take a lot of time. This patch introduces two new parameters to allow pagination of this list of checkouts Also, fix a warning in C4::ILSDI::Services::GetPatronInfo Test plan: 1. Go to /cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=X&show_loans=1 where X is a borrowernumber of a patron who has several checkouts Verify that all checkouts are listed 2. Add '&loans_per_page=1&loans_page=1' to the URL. Verify that you have now only one checkout listed, and that there is a new element <total_loans> which contain the total number of checkouts 3. Increase the page number in the URL until you have seen all checkouts 4. prove t/db_dependent/ILSDI_Services.t Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Note that we usually use 20 for default values.
Thanks for the QA :) (In reply to Jonathan Druart from comment #8) > Note that we usually use 20 for default values. Feel free to change that. I picked '10' without really thinking about it.
Nice work! Pushed to master for 19.11.00
Created attachment 91329 [details] [review] Bug 23156: [18.11] Add pagination to checkouts in ILS-DI GetPatronInfo service When patrons have a lot of checkouts, GetPatronInfo can take a lot of time. This patch introduces two new parameters to allow pagination of this list of checkouts Also, fix a warning in C4::ILSDI::Services::GetPatronInfo Test plan: 1. Go to /cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=X&show_loans=1 where X is a borrowernumber of a patron who has several checkouts Verify that all checkouts are listed 2. Add '&loans_per_page=1&loans_page=1' to the URL. Verify that you have now only one checkout listed, and that there is a new element <total_loans> which contain the total number of checkouts 3. Increase the page number in the URL until you have seen all checkouts 4. prove t/db_dependent/ILSDI_Services.t Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
I've backported to 18.11, patch seems to apply fines :) Can this be pushed to 18.11 as well?
Small and smart enhancement. Pushed to 19.05.x for 19.05.03
@Lucas : I think you can try cherry-picking to 18.11.x, and look at [18.11.x] patch if conflict.
Thanks Frido, I backported Arthur's 18.11 patch to 18.11.x for 18.11.09
Thanks Lucas :) So it will also be released in 18.11.09 then? great :) (shouldn't you provide your patch and obsolete mine?)
Arthur, I backported your patch. http://git.koha-community.org/gitweb/?p=koha.git;a=commit;h=f8b7a5f5e144e9539c1c7e7fd59904257b0ed33f It will be in 18.11.09
Awesome! Nice work everyone :)