Project

General

Profile

Actions

Bug #102479

closed

Persisting DateTimeImmutable values results in DBAL ConversionException

Added by Andreas Wolf 5 months ago. Updated 5 months ago.

Status:
Resolved
Priority:
Should have
Assignee:
Category:
-
Target version:
-
Start date:
2023-11-23
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
13
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #102807: Avoid invalid datetime database default in a testClosedStefan Bürk2024-01-10

Actions
Actions #1

Updated by Gerrit Code Review 5 months ago

  • Status changed from New to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81912

Actions #2

Updated by Gerrit Code Review 5 months ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81912

Actions #3

Updated by Gerrit Code Review 5 months ago

Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81963

Actions #4

Updated by Anonymous 5 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #5

Updated by Stefan Bürk 4 months ago

  • Related to Task #102807: Avoid invalid datetime database default in a test added
Actions

Also available in: Atom PDF