#80119Constraint Unique, Default null - String property ORM
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’.
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:
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Related issues 1
History 2
-
Riccardo De Contardi changed category <span data-processor="relativetime" data-value="2018-09-18T16:33:40+00:00" > 09/18/18, 16:33 </span>
-
Alexander Schnitzler commented and changed status
NewResolved <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::$subtitleto null and asserts the stored value; it fails without the fix.Closing as resolved.