Bugzilla – Attachment 125453 Details for
Bug 29134
Patron search has poor performance when ExtendedAttributes enabled and many attributes match
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29134: [ALTERNATIVE patch] Keep filter_by_attribute_value
Bug-29134-ALTERNATIVE-patch-Keep-filterbyattribute.patch (text/plain), 1.31 KB, created by
Jonathan Druart
on 2021-09-29 13:07:54 UTC
(
hide
)
Description:
Bug 29134: [ALTERNATIVE patch] Keep filter_by_attribute_value
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-09-29 13:07:54 UTC
Size:
1.31 KB
patch
obsolete
>From 7aa575be73d35f7e09f072041d6f41f6c4eebc8a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 29 Sep 2021 15:06:19 +0200 >Subject: [PATCH] Bug 29134: [ALTERNATIVE patch] Keep filter_by_attribute_value > >And build the IN using the existing @matching_borrowernumbers. >We have a method for that, we should not use raw SQL. >--- > C4/Utils/DataTables/Members.pm | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > >diff --git a/C4/Utils/DataTables/Members.pm b/C4/Utils/DataTables/Members.pm >index 3d677b8e010..5bd81ed2caa 100644 >--- a/C4/Utils/DataTables/Members.pm >+++ b/C4/Utils/DataTables/Members.pm >@@ -162,9 +162,8 @@ sub search { > if ( $searchfieldstype eq 'standard' and C4::Context->preference('ExtendedPatronAttributes') and $searchmember ) { > my @matching_borrowernumbers = Koha::Patrons->filter_by_attribute_value($searchmember)->get_column('borrowernumber'); > >- for my $borrowernumber ( @matching_borrowernumbers ) { >- push @where_strs_or, "borrowers.borrowernumber = ?"; >- push @where_args, $borrowernumber; >+ if ( @matching_borrowernumbers ) { >+ push @where_strs_or, " borrowers.borrowernumber IN (" . join(', ', @matching_borrowernumbers ) . ")"; > } > } > >-- >2.25.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 29134
:
125451
|
125453
|
125568
|
125649
|
125978