#105966Backend::getPlainValue() generates invalid values for null dates
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.
Reviews 2
Related issues 1
History 49
-
Alexander Schnitzler changed due date start date Follows #103641 <span data-processor="relativetime" data-value="2025-01-20T12:58:26+00:00" > 01/20/25, 12:58 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 87814 status
NewUnder Review <span data-processor="relativetime" data-value="2025-01-20T13:36:04+00:00" > 01/20/25, 13:36 </span> -
Gerrit Code Review pushed patch set 2 for main to change 87814 <span data-processor="relativetime" data-value="2025-01-20T13:40:55+00:00" > 01/20/25, 13:40 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 87882 <span data-processor="relativetime" data-value="2025-01-25T18:54:26+00:00" > 01/25/25, 18:54 </span>
-
Anonymous commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2025-01-25T18:55:12+00:00" > 01/25/25, 18:55 </span> -
Gerrit Code Review pushed patch set 2 for 13.4 to change 87882 status
ResolvedUnder Review <span data-processor="relativetime" data-value="2025-01-27T19:06:23+00:00" > 01/27/25, 19:06 </span> -
Gerrit Code Review pushed patch set 3 for 13.4 to change 87882 <span data-processor="relativetime" data-value="2025-01-27T19:12:49+00:00" > 01/27/25, 19:12 </span>
-
Anonymous commented and changed status
Under ReviewResolved <span data-processor="relativetime" data-value="2025-01-28T07:30:10+00:00" > 01/28/25, 07:30 </span>Applied in changeset commit:d0a4a56af742e474131920e5acbb5eefd90c9ea9.
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2025-08-12T14:35:40+00:00" > 08/12/25, 14:35 </span>
Applied in changeset commit:ff77e4fc77e6f94cce92301c4a48276dad924121.