Issue Bug Resolved

#80119Constraint Unique, Default null - String property ORM

Noel Blaschke 03/03/17, 17:11 updated 10/17/26, 13:35

Description

Hey guys,

it’s not possible to have a table with a column unique constraint that has also the default value NULL (not a string).

Updating a model with its setter method e.x.: model->setProp(NULL) will convert the NULL value to string ‘NULL’.

Code: https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php#L415

Creating a second model and updating its property to NULL will throw an exception because the database integrity is violated (2 columns with string ‘NULL’ can’t exist).

In another case this is already considered:

https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php#L409

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 2

  1. Alexander Schnitzler commented and changed status New Resolved <span data-processor="relativetime" data-value="2026-10-17T13:35:46+00:00" > 10/17/26, 13:35 </span>

    This is resolved in core. @Backend::getPlainValue()@ returns null for a null value instead of passing it on to @DataMapper::getPlainValue()@, which turned it into the string 'NULL'. The ticket was already fixed when it was created.

    Fixed by b61e71170ff “Return null value instead of string ‘NULL’” (#68994, 9.0.0; 8.7: b2bd51f9dab, 8.7.9).

    Covered by an existing test on main: Extbase Functional @Persistence/UpdateTest::updateObjectSetsNullAsNullForSimpleTypes@ sets Blog::$subtitle to null and asserts the stored value; it fails without the fix.

    Closing as resolved.