Bug with advanced search

jfquestiaux

Well-Known Member
I have a list with several dates elements. Some records have some dates filled in, others don't, so I am using the advanced search to look for records with empty dates.

For dates, there is no obvious way to do it because an "empty" date has actually '0000-00-00 00:00:00' in the database column, so an advanced search on "is empty" does not work.
A search on "date_element IS EQUAL TO 0000-00-00 00:00:00" works though, or at least should work because the search return an SQL error.

The problem is in the WHERE condition: the query produced has
WHERE ( `contacts`.`date_MdB` = (0000-00-00 00:00:00) )

where it should be

WHERE ( `contacts`.`date_MdB` = '0000-00-00 00:00:00' )
(this works when run directly in phpmyadmin)

Tested on Joomla 3.2.2/Fabrik 3.1 + latest GitHub (24).

By the way, it's not very user friendly to have the user enter '0000-00-00 00:00:00' as search value. Is there another way to look for empty date elements?
 
Well, I still get an SQL error with the advanced search "is empty" for a date:

DateTime::__construct(): Failed to parse time string ('0000-00-00 00:00:00') at position 0 ('): Unexpected character
 
I also have the same issue as described in the first post with prefilter: if I prefilter a date element with "NOT EQUALS TO" 0000-00-00 00:00:00, I have a SQL error because the query contains "
contacts.date_balisage <> (0000-00-00 00:00:00)" instead of "contacts.date_balisage <> '0000-00-00 00:00:00'", even though the type is set on "text".

This is strange because I have other prefilters (in other lists) on different elements than date, with the type set on "text" and the query is correct.

testedt with GitHub 45.

This is a very important issue for me for this project.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top