Project

General

Profile

Actions

Bug #103641

open

Not possible so set nullable relation values in extbase domain models

Added by Torben Hansen 16 days ago. Updated 6 days ago.

Status:
Under Review
Priority:
Must have
Assignee:
Category:
-
Target version:
-
Start date:
2024-04-16
Due date:
% Done:

0%

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

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)


Related issues 1 (1 open0 closed)

Related to TYPO3 Core - Bug #88515: Cannot unset DateTime value via nullAccepted2019-06-07

Actions
Actions #1

Updated by Torben Hansen 16 days ago

  • Related to Bug #88515: Cannot unset DateTime value via null added
Actions #2

Updated by Torben Hansen 16 days ago

  • TYPO3 Version changed from 12 to 13
Actions #3

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

Actions #4

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

Actions #5

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

Actions #6

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

Actions #7

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

Actions #8

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

Actions #9

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

Actions

Also available in: Atom PDF