Field 'fieldname' doesn't have a default value

Resolve a MySQL field default value error in ChronoForms.

Overview

The error occurs because MySQL drivers in Joomla 4 use STRICT_TRANS_TABLES mode, which requires a default value for fields not explicitly passed during data insertion.
Modify the database column to add a default value or ensure the form passes a value for the field when saving data.

Answered
ChronoForms v7
Fr Fredolino 06 Jan, 2023
Hi

A single form gives this error when saving. This also affects other fields that are not explicitly in the value list in the save, but are automatically added via the names of the fields. In this case, a default value must be stored in the DB.
The problem did not exist in version 6 in Joomla 3.xx. In version 7 in Joomla 4
this is new for me. However, this only affects a single form in CF7.
Has anyone been able to solve the problem? And if so, how?

F.
Fr Fredolino 06 Jan, 2023
Answer
answer:
MySQL drivers in 4.0 use STRICT_TRANS_TABLES mode.
You modify the column to add the default value or pass the value when inserting data.
This topic is locked and no more replies can be posted.