Skip to content

bRegex error #9

@linojon

Description

@linojon

I encountered an error where the search text input was generating a string like
search[last_name_or_first_name_or_middle_namefalse]=L

i think it was trying to generate
search[last_name_or_first_name_or_middle_name_sw]=L

In the file simple_datatables.js.coffee, bRegex is initialized to false, and then line 71 says
op = bRegex ? "_contains" : "_sw"
which compiles to
op = bRegex != null ? bRegex : {
"_contains": "_sw"
};
so the next line
data.push({
name: "search[" + searchcolumns.join("or") + op + "]",
value: sSearch
});
appends "false".
The following change seems to fix the problem
// op = bRegex ? "_contains" : "_sw"
if (bRegex)
op = "_contains"
else
op = "_sw"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions