Project

General

Profile

Actions

Bug #105966

closed

Backend::getPlainValue() generates invalid values for null dates

Added by Alexander Schnitzler 27 days ago. Updated 19 days ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
Extbase
Start date:
2024-04-17
Due date:
2024-04-17
% Done:

100%

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

Description

https://review.typo3.org/c/Packages/TYPO3.CMS/+/83839 introduced a regression when using nullable \DateTime properties in entities being stored as DATETIME in the database.

Prior to that patch, Backend::getPlainValue() directly returned the incoming null, now it is converted to an invalid string value of 0000-00-00

If 0000-00-00 is a valid value for database engines is an interesting question but not the issue here. Most probably it's not because such a value is considered invalid during reconstitution of persisted entities as seen in \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper::mapDateTime() where an incoming value 0000-00-00 is cast to null.

A solution here should be to check if the property allows null. Regardless of the dbType and the TCA, Extbase should early return the given null.


Related issues 1 (0 open1 closed)

Follows TYPO3 Core - Bug #103641: Not possible so set nullable relation values in extbase domain modelsClosedTorben Hansen2024-04-16

Actions
Actions #1

Updated by Alexander Schnitzler 27 days ago

  • Due date set to 2024-04-17
  • Start date changed from 2025-01-20 to 2024-04-17
  • Follows Bug #103641: Not possible so set nullable relation values in extbase domain models added
Actions #2

Updated by Gerrit Code Review 27 days 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/+/87814

Actions #3

Updated by Gerrit Code Review 27 days 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/+/87814

Actions #4

Updated by Gerrit Code Review 22 days ago

Patch set 1 for branch 13.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/+/87882

Actions #5

Updated by Anonymous 22 days ago

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

Updated by Gerrit Code Review 20 days ago

  • Status changed from Resolved to Under Review

Patch set 2 for branch 13.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/+/87882

Actions #7

Updated by Gerrit Code Review 20 days ago

Patch set 3 for branch 13.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/+/87882

Actions #8

Updated by Anonymous 19 days ago

  • Status changed from Under Review to Resolved
Actions

Also available in: Atom PDF