Bug #91731
openCannot empty a date field in TCEforms if MySQL is in strict mode
0%
Description
Steps to reproduce:
1. Have MySQL in strict mode (i.e., the default configuration without any changes): STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION (this is MariaDB's default)
1. Have an extension with a date or datetime field that uses the config 'eval' => 'date' or 'eval' => 'datetime'
1. Fill in a date and save.
1. Empty the date (by using the "clear" icon) and save again.
Expected result:
The date field is emptied, and there is no error message.
Actual result:
The date field still has the date value (that should have been removed), and an error flash message is displayed:
SQL error: 'Incorrect integer value: " for column `…'
Additional information:
Bug report in the seminars extension:
https://github.com/oliverklee/ext-seminars/issues/548
Workaround in the seminars extension:
Add an int eval: https://github.com/oliverklee/ext-seminars/pull/549/files
So empty date and datetime fields need to be cast to an integer before saving so that an empty value gets converted to 0.