From 5e29433bdc3a5ccd582ece6e2338c6e38e97c5d9 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 --- 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 2d29b2138e..b6d58955c3 100644 --- a/C4/Reports/Guided.pm +++ b/C4/Reports/Guided.pm @@ -559,7 +559,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 2e66535c00..29b378bc70 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 + +