#102479Persisting DateTimeImmutable values results in DBAL ConversionException
Description
This only happens if the type is explicitly specified via the $types parameter of `insert()` etc., like e.g. doctrine/migrations does since version 3.7 (cf. https://github.com/andreaswolf/typo3-ext-migrations/pull/20#issuecomment-1823213679).
Stack trace:
Doctrine\DBAL\Types\ConversionException: Could not convert PHP value '2023-11-23 11:49:00' to type datetime_immutable. Expected one of the following types: null, DateTimeImmutable /data/www/typo3/dev/dev-main/vendor/doctrine/dbal/src/Types/ConversionException.php:80 /data/www/typo3/dev/dev-main/vendor/doctrine/dbal/src/Types/DateTimeImmutableType.php:45 /data/www/typo3/dev/dev-main/vendor/doctrine/dbal/src/Connection.php:1849 /data/www/typo3/dev/dev-main/vendor/doctrine/dbal/src/Connection.php:1790 /data/www/typo3/dev/dev-main/vendor/doctrine/dbal/src/Connection.php:1200 /data/www/typo3/dev/dev-main/vendor/doctrine/dbal/src/Connection.php:812 /data/www/typo3/dev/dev-main/typo3/sysext/core/Classes/Database/Connection.php:213
The
Reviews 5
- 14.3 94891[BUGFIX] Honor parameter types in writable Connection methods
- main 89293[BUGFIX] Honor parameter types in writable Connection methods
- main 90957[WIP][!!!][TASK] Disable converting values by default in `Connection`
- 12.4 81963[BUGFIX] Allow persisting values with Doctrine type datetime_immutable
- main 81912[BUGFIX] Allow persisting values with Doctrine type datetime_immutable