diff --git a/src/Persistence.php b/src/Persistence.php index 97cf7f16a..de748d85d 100644 --- a/src/Persistence.php +++ b/src/Persistence.php @@ -503,10 +503,6 @@ protected function _typecastSaveField(Field $field, $value) { $value = $this->_typecastPreField($field, $value, false); - if (in_array($field->type, ['json', 'object'], true) && $value === '') { // TODO remove later - return null; - } - // native DBAL DT types have no microseconds support if ($value !== null && in_array($field->type, ['datetime', 'date', 'time'], true) && str_starts_with(get_class(Type::getType($field->type)), 'Doctrine\DBAL\Types\\') diff --git a/tests/TypecastingTest.php b/tests/TypecastingTest.php index 3d4ab8424..233eeab06 100644 --- a/tests/TypecastingTest.php +++ b/tests/TypecastingTest.php @@ -206,7 +206,8 @@ public function testEmptyValues(): void self::assertNull($mm->get('local-object')); unset($row['id']); - unset($row['local-object']); + $row['json'] = null; + $row['local-object'] = null; $mm->setMulti($row); self::assertSame($fixEmptyStringForOracleFx(''), $mm->get('string'));