From 1259782789aeebf18d82b7af38c9b13e5df085e0 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 6 Apr 2020 11:44:18 +0200 Subject: [PATCH] Bug 24964: Do not fetch all patrons for owner/users of funds admin/add_user_search.pl sets 'patrons_with_acq_perm_only', to only retrieve patrons with acq (order_manage) permissions. The original bug was hidden in the existing code, but the behavior was terrible. To prevent patrons matching the permissions contrainst to be hidden, we fetched ALL the patrons from the DB, then filtered them depending on their permissions. This might have awful performance on DB with lot of patrons. So basically with this patch we are adding the pagination back to the "owner/users for funds" feature, as the permission filtering is now done at DB level. --- C4/Utils/DataTables/Members.pm | 1 + .../intranet-tmpl/prog/en/modules/common/patron_search.tt | 8 ++------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/C4/Utils/DataTables/Members.pm b/C4/Utils/DataTables/Members.pm index b0d1d0b1d7..72127a2640 100644 --- a/C4/Utils/DataTables/Members.pm +++ b/C4/Utils/DataTables/Members.pm @@ -194,6 +194,7 @@ sub search { ($orderby ? $orderby : ""), ($limit ? $limit : "") ); + warn $query; $sth = $dbh->prepare($query); $sth->execute(@where_args); my $patrons = $sth->fetchall_arrayref({}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/common/patron_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/common/patron_search.tt index f8dcf45440..b78ec9bd31 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/common/patron_search.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/common/patron_search.tt @@ -201,12 +201,8 @@ [% END %] ], 'bAutoWidth': false, - [% IF patrons_with_acq_perm_only %] - 'bPaginate': false, - [% ELSE %] - 'sPaginationType': 'full_numbers', - "iDisplayLength": [% Koha.Preference('PatronsPerPage') | html %], - [% END %] + 'sPaginationType': 'full_numbers', + "iDisplayLength": [% Koha.Preference('PatronsPerPage') | html %], 'aaSorting': [[[% aaSorting || 0 | html %], 'asc']], 'bFilter': false, 'bProcessing': true, -- 2.20.1