Bugzilla – Attachment 102434 Details for
Bug 24964
Do not filter patrons AFTER they have been fetched from the DB (when searching with permissions)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24964: Do not fetch all patrons for owner/users of funds
Bug-24964-Do-not-fetch-all-patrons-for-ownerusers-.patch (text/plain), 2.41 KB, created by
Jonathan Druart
on 2020-04-06 09:49:00 UTC
(
hide
)
Description:
Bug 24964: Do not fetch all patrons for owner/users of funds
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-04-06 09:49:00 UTC
Size:
2.41 KB
patch
obsolete
>From 1259782789aeebf18d82b7af38c9b13e5df085e0 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24964
:
101668
|
101669
|
101686
|
101702
|
101813
|
101814
|
101815
|
101820
|
101821
|
101822
|
101823
|
102434
|
102435
|
102457
|
102458
|
102459
|
102460
|
102461