DMXzone App Connect Support Product Page

Solved

Problem with search form with more than one input field

Reported 23 Mar 2017 16:31:53
1
has this problem
23 Mar 2017 16:31:53 Tom Dupre posted:
I have a simple form with two text inputs and a submit button. If I use enter a search term into each field, the search works correctly. However if a search term is entered into only one field, the search fails.

If only one field has a value, the SQL query generated by Server Connect is 'true' for this field - so only columns including the word 'true' are returned which is of course not likely to be useful. I want the field which is not used to produce '' in the query, not 'true'. I expect the answer is using Server Data Formatter - I've tried this but so far without success.

I've included an example below. I can't imagine this would ever be what you want/expect - perhaps it's a bug.

I would be grateful for any help.
--

query string: ?author=bowen&title= (ie search term entered only in Author field)

WHERE
`author` LIKE CONCAT('%', 'bowen', '%') ESCAPE '!'
AND `title` LIKE CONCAT('%', 'true', '%') ESCAPE '!'

Replies

Replied 23 Mar 2017 17:52:31
23 Mar 2017 17:52:31 Tom Dupre replied:
I have found a solution - by adding conditions to the relevant fields, eg:
{{$_GET.title && $_GET.title != "true"}}
This is what I tried to enter vith the Server Data Formatter. Quite often it seems I discover how the interface works by typing in the code first but this approach tends to require much trial and error.

I can't imagine it should be necessary to do this and if the search term happens to be the word 'true', the search will fail. Unless I'm going about this in the wrong way (which is quite possible as I don't know these extensions well), I think this is a bug. At least if it's fixed, it shouldn't break this workaround.

I would have thought this must be a very common need - a search form with a few fields. I would be grateful for any help if I'm missing something obvious.
Replied 27 Mar 2017 09:11:18
27 Mar 2017 09:11:18 Teodor Kuduschiev replied:
Hi Tom,
This will be fixed in this week's update.
Replied 27 Mar 2017 09:17:48
27 Mar 2017 09:17:48 Tom Dupre replied:
Hi Teodor,
That would be great - thanks.
Replied 28 Mar 2017 13:55:09
28 Mar 2017 13:55:09 Teodor Kuduschiev replied:
Hi Tom,
Please update to the latest version, this issue is fixed there.
Replied 28 Mar 2017 14:37:26
28 Mar 2017 14:37:26 Tom Dupre replied:
Hi Teodor,
This certainly seems to have fixed the problem - thanks..

Reply to this topic