Project

General

Profile

Actions

Bug #103641

closed

Not possible so set nullable relation values in extbase domain models

Added by Torben Hansen 3 months ago. Updated 8 days ago.

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

100%

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 (0 open1 closed)

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

Actions
Actions #1

Updated by Torben Hansen 3 months ago

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

Updated by Torben Hansen 3 months ago

  • TYPO3 Version changed from 12 to 13
Actions #3

Updated by Gerrit Code Review 3 months 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 3 months 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 3 months 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 3 months 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 3 months 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 3 months 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 3 months 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 #10

Updated by Torben Hansen 2 months ago

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

Updated by Benni Mack 8 days ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF