Bug 30626: DT REST API wrapper - Fix general search

The general search query is not built correctly.

Say you have a table with column filters, like the main patron search:
General filter: henry
Specific filter on the 'Name' column: h

The generated query will be (= are actually LIKE):
{ Column1="henry" AND Column3="henry", ...} AND { Column2="h" }

The first term does not contain the Column2 attribute.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Jonathan Druart 2022-04-27 12:33:03 +02:00 committed by Fridolin Somers
parent f2d2ab1810
commit cf630a5169
1 changed files with 1 additions and 1 deletions

View File

@ -600,7 +600,7 @@ 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 && typeof col.data == 'string' && data.columns[col.idx].search.value == '' && filter != ''
return col.bSearchable
})
.map(function(col) {
var value = filter;