Update 3.8.x use of 'now()' in prefilter

Status
Not open for further replies.

Borox

Member
Hi,

I'm testing after an update to 3.8.1 ( was using 3.7)

Something change with prefilter?

I was using :
upload_2018-3-27_17-16-48.png
It was working, but now I need to use, for 'Type', 'no quote' or 'query'.
It makes sense to use 'query' instead of 'Text', but I wanted to be sure that someting has change with prefilter.

Thanks
 
Correct, you need to use 'no quotes'.

Prior to 3.8.1, a bug in the code meant that using type 'text' would work for "now()", as we were automatically not adding quotes for values being used in pre-filters for date elements, even for type "text" (which really just means "add quotes to this value"). But that meant that (say) comparing a date with "EQUALS" and "0000-00-00 00:00:00" (to find null dates) was erroring out, as it gave "WHERE yourdate = 0000-00-00 00:00:00" with no quotes, which is a syntax error.

But of course fixing that now means that using NOW() with type "text" yields "WHERE yourdate > 'NOW()'", which doesn't work because it compares with the string 'NOW()' instead of the result of the function NOW().

So we now correctly handle date pre-filters, and only don't use quotes if you select "no quotes".

-- hugh
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top