Skip to content
Snippets Groups Projects
Commit 30399b0e authored by Torben Hansen's avatar Torben Hansen Committed by Benni Mack
Browse files

[BUGFIX] Allow persisting nullable properties in extbase

Extbase persistence does not treat nullable properties like
DataHandler does. A nullable domain model property, which
either implements `DomainObjectInterface` or is of type
`DateTime`, can not be set to null again, when the object is
already persisted with a value not equal to null.

DataHandler respects this scenario by using the value of the
`default` config TCA key for affected relation fields or by
typecasting an empty value to integer for `datetime` fields.
For `datetime` fields, additionally the `dbType` is evaluated
and an empty value is transformed to the corresponding
dbType empty value.

This change covers both scenarios in extbase persistence,
so it is possible to set properties to `null`, if the
property either implements `DomainObjectInterface` or
is of type `DateTime`.

Resolves: #103641
Related: #88515
Releases: main
Change-Id: I17767b34ac75bb7387a6fc3c6e7345a7d3d25d86
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83839


Tested-by: default avatarSimon Schaufelberger <simonschaufi+typo3@gmail.com>
Tested-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
Tested-by: default avatarcore-ci <typo3@b13.com>
Reviewed-by: default avatarSimon Schaufelberger <simonschaufi+typo3@gmail.com>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
parent 1e8e8eb5
Branches
Tags
Showing
with 172 additions and 15 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment