Bugzilla – Attachment 134250 Details for
Bug 30643
Useless query part generated by DT REST API wrapper
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30643: Remove useless OR part from query generated by DT REST API wrapper
Bug-30643-Remove-useless-OR-part-from-query-genera.patch (text/plain), 2.99 KB, created by
Jonathan Druart
on 2022-04-28 12:38:19 UTC
(
hide
)
Description:
Bug 30643: Remove useless OR part from query generated by DT REST API wrapper
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-04-28 12:38:19 UTC
Size:
2.99 KB
patch
obsolete
>From 30c1c321b4a387d8b468ea045f09630cc2d1da4f Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 28 Apr 2022 14:36:18 +0200 >Subject: [PATCH] Bug 30643: Remove useless OR part from query generated by DT > REST API wrapper > >To test: >Don't apply this patch >Search for patrons on the main patron search >Notice the {"me.firstname":{"like":"%%"}}, etc. >Apply this patch and confirm that the query is now correctly formed >--- > koha-tmpl/intranet-tmpl/prog/js/datatables.js | 25 ++++++++++--------- > 1 file changed, 13 insertions(+), 12 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >index 2c05bd4a464..8f4f65b7f9b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >@@ -583,7 +583,6 @@ jQuery.fn.dataTable.ext.errMode = function(settings, note, message) { > return parts; > } > >- var filter = data.search.value; > // Build query for each column filter > var and_query_parameters = settings.aoColumns > .filter(function(col) { >@@ -598,17 +597,19 @@ jQuery.fn.dataTable.ext.errMode = function(settings, note, message) { > }); > > // Build query for the global search filter >- var or_query_parameters = settings.aoColumns >- .filter(function(col) { >- return col.bSearchable >- }) >- .map(function(col) { >- var value = filter; >- return build_query(col, value) >- }) >- .map(function r(e){ >- return ($.isArray(e) ? $.map(e, r) : e); >- }); >+ var global_filter = data.search.value; >+ var or_query_parameters = global_filter.length >+ ? settings.aoColumns >+ .filter(function(col) { >+ return col.bSearchable >+ }) >+ .map(function(col) { >+ return build_query(col, global_filter) >+ }) >+ .map(function r(e){ >+ return ($.isArray(e) ? $.map(e, r) : e); >+ }) >+ : []; > > if ( default_filters ) { > let additional_filters = {}; >-- >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 30643
: 134250