fix exception when trying to store a DateTime

This commit is contained in:
Ralf Becker 2021-02-19 21:29:33 +02:00
parent e1b9d993a5
commit fdecefebd4

View File

@ -640,7 +640,8 @@ class Base
} }
else else
{ {
$data[$db_col] = (string) $this->data[$col] === '' && $this->empty_on_write == 'NULL' ? null : $this->data[$col]; $data[$db_col] = !is_a($this->data[$col], 'DateTime') && (string)$this->data[$col] === '' &&
$this->empty_on_write == 'NULL' ? null : $this->data[$col];
} }
} }
} }