When using “select-multiple” in a drop-down, if the field being returned has a comma it does not search correctly. When viewing the ‘debug’ it splits the field into two-parts with the comma.
Is there a way to escape the comma so it combines the field into a single search-string?
Thanks for any help
Hello Mike,
Apologies for the delay in ticket reply. Can you share some screenshot showing this issue?
I tried it on demo but unable to generate this issue.
The issue isn’t the display – it’s the actual selection criteria once you select the field with a comma.
In your example if you select that entry it will not search for “Client = ‘Ana Trujilos'”, It will search for “Client in (‘Ana’,’Trujilos’)
So we never get a match on any fields that contain a comma when searching because it splits the field out into a comma separated list, not a single entry.
Thanks
Mike
By my findings, It currently uses contains search in finding results. It is not related to comma. You need exact search, it is not supported in the version of multiselect-filter we are using now.
If you mean something else, please share steps with test data. and screenshot.
The search doesn’t work at all. If you select a field using multi-select and the field has a comma it will NOT find any results for the field that has the comma. That is the problem.
So if a field has a comma the multi-select doesn’t work. That is what I need a work-around for.
Thank you
Can we have a remote session on google hangouts?
I want to see the issue live, perhaps i am not understanding it correctly till now.
I’ll see what I can do time-wise . . . I’m back and forth between projects tomorrow then I’m out of town for a couple of days.
I’ll try to explain it a bit better.
We have a drop-down field of business names and some of them have commas.
If I add a multi-select and select one of the names without a comma in it, the report will display results for that name correctly.
If I select one of the names with a comma in the field, nothing is displayed on the report. It’s almost like it is not there. If I convert to a single select it works fine.
I think the issue is the comma is being interpreted as a field delimiter and splitting the field – rather than wrapping the entire field in a single quote.
So using your example again, if I select a field that is in the database as “Ana, Trujilos” I would expect the quer to be:
SELECT * FROM TABLE WHERE NAME in (‘Ana, Trujilos’)
But instead, when I turn-on the debugger, the SQL Query is being sent like this:
SELECT * FROM TABLE WHERE NAME IN (‘Ana’, ‘Trujilos’)
As you can see it splits-out the field into two entries rather than one and it won’t ever match.
Hope this helps
Thanks again!
Mike
Your last reply helped much and i’ve regenerated the issue. Will be updating back after some working.
Just resolved it and emailed you an update.
Forget to tell, little modification in code is also required. As multi-select expect the keys to be numeric so it passes values as “2,3,4,5,6”. Now as you are using STRING as keys, you need to cover string in quotes. e.g.
$str = $g->get_dropdown_values(“select distinct concat(\”‘\”,note,\”‘\”) as k, note as v from invheader limit 10″);
$col[“editoptions”] = array(“value”=>”:;”.$str);
$col[“stype”] = “select-multiple”;
$col[“searchoptions”][“value”] = $str;
The single quotes around key will help differentiating records when using with IN operator of sql.