From 2e34137e11bbb357a5fd85393b6d4a42ad5d6eea Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Mon, 10 Jul 2023 17:03:34 +0000 Subject: [PATCH] Bug 34223: PROOF OF CONCEPT The following command will (hopefully) reset your ILL data and create 10k fake ILL requests (run this in DEV KTD only). 1) On an empty k-t-d, run: bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev-data.sh) 2) Pet a cat 3) Visit /cgi-bin/koha/ill/ill-requests.pl and select a backend on the left side filters 4) Notice how the status filter takes a while (3-5 secs) to load 5) Apply patch and koha-plack --restart kohadev 6) Repeat 3, notice how the status filter now loads fast --- Koha/Database.pm | 2 +- Koha/Illbackend.pm | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Koha/Database.pm b/Koha/Database.pm index 376f910c98..ec0cb28057 100644 --- a/Koha/Database.pm +++ b/Koha/Database.pm @@ -103,7 +103,7 @@ sub dbh { || $ENV{KOHA_TESTING} ) { push @queries, q{ - SET sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION' + SET sql_mode = 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION' }; } else { push @queries, q{SET sql_mode = 'IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'} diff --git a/Koha/Illbackend.pm b/Koha/Illbackend.pm index 8a6be8a7a6..d84a0f31cd 100644 --- a/Koha/Illbackend.pm +++ b/Koha/Illbackend.pm @@ -53,10 +53,10 @@ sub existing_statuses { # the ILL request returns the correct status and info respective to its backend. my $ill_requests = Koha::Illrequests->search( {backend => $backend_id}, - # { + { # columns => [ qw/status/ ], - # group_by => [ qw/status/ ], - # } + group_by => [ qw/status/ ], + } ); my @data; -- 2.30.2