ludak
Active member
I have the schemaManager defining the columns as this
When I originally save the form everything is fine if I do not save with any values in there.
But once I set the value in the row, I cannot go back and unset it to be null again.
I am getting this.
How can I unset this property prior to saving the edit record to database so that it saves as null again.
Code:
$table->addColumn('result', 'enum')->values(['1', 'X', '2'])->nullable();
When I originally save the form everything is fine if I do not save with any values in there.
But once I set the value in the row, I cannot go back and unset it to be null again.
I am getting this.
XF\Db\Exception: MySQL query error [1265]: Data truncated for column 'result' at row 1 in src\XF\Db\AbstractStatement.php at line 212
How can I unset this property prior to saving the edit record to database so that it saves as null again.