From 47ebd758c7354c26b57929665a703ecc690d8656 Mon Sep 17 00:00:00 2001 From: Kyle Hall Date: Mon, 1 Aug 2022 10:47:04 -0400 Subject: [PATCH] Bug 31276: Report results are limited to 999,999 no matter the actual number of results In Koha, any report that uses C4::Reports::Guided will be limited to 999,999 rows. This is causing problems for larger libraries where some reports may have over a million results. Test Plan: 1) Create a report "SELECT * FROM borrowers" and run it, note the number of results 2) Apply this patch 3) Add the line `3` within the block of your koha-conf.xml 4) Restart all the things! 5) Run the report, download the results as a CSV 6) Note your CSV only has 4 lines, the header and 3 patrons Signed-off-by: Rachael Laritz Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 5e29433bdc3a5ccd582ece6e2338c6e38e97c5d9) Signed-off-by: Lucas Gass (cherry picked from commit ae71ac66f8933c50d27c3a9dffb1845f19b606f8) Signed-off-by: Arthur Suzuki --- C4/Reports/Guided.pm | 2 +- debian/templates/koha-conf-site.xml.in | 4 ++++ etc/koha-conf.xml | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/C4/Reports/Guided.pm b/C4/Reports/Guided.pm index 986fb0e97f..b93b6ece96 100644 --- a/C4/Reports/Guided.pm +++ b/C4/Reports/Guided.pm @@ -558,7 +558,7 @@ sub execute_query { my $params = shift; my $sql = $params->{sql}; my $offset = $params->{offset} || 0; - my $limit = $params->{limit} || 999999; + my $limit = $params->{limit} || C4::Context->config('report_results_limit') || 999999; my $sql_params = defined $params->{sql_params} ? $params->{sql_params} : []; my $report_id = $params->{report_id}; diff --git a/debian/templates/koha-conf-site.xml.in b/debian/templates/koha-conf-site.xml.in index 20d217222d..f0a07d6d61 100644 --- a/debian/templates/koha-conf-site.xml.in +++ b/debian/templates/koha-conf-site.xml.in @@ -304,6 +304,10 @@ __END_SRU_PUBLICSERVER__ __API_SECRET__ + + CHANGEME + +