Bug #103641
openNot possible so set nullable relation values in extbase domain models
0%
Description
When an extbase domain Model has a property, which implements DomainObjectInterface
and is nullable, it is impossible to set the property of an existing object to null
, because the database field is defined does not accept NULL
as value. When saved through DataHandler, a nullable (e.g. tca=group) field saves 0
as value for those fields.
Example:
protected ?Person $author = null;
If the object with the $author
property is persisted with a valid relation to a Person
model, Extbase persists the UID of the person. Setting the field to null
e.g. in controller (e.g. $blog->setAuthor(null)
), results in the following exception Column 'author cannot be null
, since Extbase persistence tries to save a NULL
value to the not nullable database field.
Extbase should consider this scenario and save 0
for nullable properties which implement DomainObjectInterface
The same applies to nullable DateTime
fields, which show the same behavior. (see #88515)
Updated by Torben Hansen 16 days ago
- Related to Bug #88515: Cannot unset DateTime value via null added
Updated by Gerrit Code Review 16 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/+/83839
Updated by Gerrit Code Review 16 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/+/83839
Updated by Gerrit Code Review 15 days ago
Patch set 3 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/+/83839
Updated by Gerrit Code Review 15 days ago
Patch set 4 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/+/83839
Updated by Gerrit Code Review 14 days ago
Patch set 5 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/+/83839
Updated by Gerrit Code Review 10 days ago
Patch set 6 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/+/83839
Updated by Gerrit Code Review 6 days ago
Patch set 7 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/+/83839