Error Incorrect DATETIME value: '' with Mysql 8

10 months 4 days ago - 10 months 4 days ago #6402 by thbl
Hello :)

I just installed a fresh Joomla environment with a Mysql 8.0 database, for testing JS Support Ticket. 
Joomla works well. Then I installed JS Ticket free edition. 
The installation process is working. 
Then , I go to Joomla administrator, Components > JS Support Ticket, and I get an error page (see attachment). 
The error states 1525 Incorrect DATETIME value: '' 



The faulting query is in file administrator\components\com_jssupportticket\models\jssupportticket.php:39: 
SELECT priority.priority,
(SELECT COUNT(id) FROM `j3_js_ticket_tickets` WHERE priorityid = priority.id AND isanswered != 1 AND status != 4 AND (lastreply != '0000-00-00 00:00:00' AND lastreply != '') 
AND date(created) >= '2019-11-01' AND date(created) <= '2019-12-01') AS totalticket
FROM `j3_js_ticket_priorities` AS priority ORDER BY priority.priority

... because it contains  (lastreply != '0000-00-00 00:00:00' AND lastreply != '') 
It seems to be related to Mysql's SQL_MODE
=>  dev.mysql.com/doc/refman/8.0/en/sql-mode...sqlmode_no_zero_date  

The no_zero_date and the strict mode seem to forbid the use of '0000-00-00 ...' and empty '' dates. 
As far as I read, these changes in Mysql appeared in 5.7. 
=> I think it would be good to you make changes to your database model and queries for avoiding the use of theses syntaxes, so that your component can work on a Mysql db, out of the box. 

Cheers, 
thbl
Attachments:
4 months 4 days ago #6463 by David
I have this same issue and wondering what I can do to resolve this.

Thank You

David
Time to create page: 0.146 seconds

Please publish modules in offcanvas position.