Feature #41773

Add possibility to store NULL values

Added by Oliver Hader almost 7 years ago. Updated 12 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
-
Start date:
2012-10-09
Due date:
% Done:

100%

PHP Version:
5.3
Tags:
Complexity:
medium
Sprint Focus:

Description

The current implementation in the TYPO3 backend does not allow to store NULL values, only empty strings or zero as number are allowed.
Since the overlay behavior of FAL takes e.g. the description property from the original file object an empty value in the disposal (the referenced file) cannot be defined to be blank, thus not clearing the original file description.

For this case we need a new behavior to allow NULL values in the storage and to handle that in the backend view.

For this a new TCA eval property needs to be created null, e.g.

'config' = array(
'type' => 'input',
'eval' => 'null',
...
);


Related issues

Related to TYPO3 Core - Bug #17624: can't set TCA field (and therefore db field) to NULL Closed 2007-09-24
Related to TYPO3 Core - Bug #43139: Activating NULL value field does not work with blank string Closed 2012-11-20
Related to TYPO3 Core - Feature #43133: Integrate possibility to determine NULL values in TypoScript Closed 2012-11-20
Related to TYPO3 Core - Bug #43132: File Reference cannot be used to disable specific meta data Closed 2012-11-20
Related to TYPO3 Core - Bug #53662: DatabaseConnection INSERTquery does not allow NULL values Closed 2013-11-15

Associated revisions

Revision 9f1efb64 (diff)
Added by Oliver Hader almost 7 years ago

[FEATURE] Add possibility to store NULL values

The current implementation in the TYPO3 backend does not allow
to store NULL values, only empty strings or zero as number are
allowed.
Since the overlay behavior of FAL takes e.g. the description
property from the original file object an empty value in the
disposal (the referenced file) cannot be defined to be blank,
thus not clearing the original file description.

For this case we need a new behavior to allow NULL values in
the storage and to handle that in the backend view.

This feature is enabled by adding "null" to the eval list of
the TCA configuration of a field, example:

'columns' => array(
'title' => array(
'config' => array(
'type' => 'text',
'eval' => 'null',
)
)
)

Besides that, of course the database field definition needs to
be updated to support NULL values.

Change-Id: Ib5cd0e34e34d084df7ba3380ae81e5240bcf76d6
Resolves: #41773
Releases: 6.0
Reviewed-on: http://review.typo3.org/15458
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader

History

#1 Updated by Gerrit Code Review almost 7 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/15458

#2 Updated by Gerrit Code Review almost 7 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/15458

#3 Updated by Gerrit Code Review almost 7 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/15458

#4 Updated by Gerrit Code Review almost 7 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/15458

#5 Updated by Oliver Hader almost 7 years ago

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

#6 Updated by Klaus Hinum about 6 years ago

As soon as I add "eval" => "null" the field is not editable in the backend any more. Is there a missing setting or is this on purpose? How can I edit the field then?

#7 Updated by Ernesto Baschny almost 6 years ago

  • Target version deleted (6.0.0-RC1)

Hi Klaus. When you enable "eval=>null" you will get a new checkbox besides your input field. The field is only "activated" once this checkbox is clicked (thus allowing to store the "empty string"). Once you click the checkbox, the field is disabled (and NULL is stored in the DB).

I noticed that the position of this checkbox is a bit bogus (at least in the current master), I opened up an issue to get that fixed (#52261).

Does that explain the feature to you and why the field is disabled at first? Probably you didn't notice the new checkbox.

#8 Updated by Benni Mack 12 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF