Project

General

Profile

Actions

Bug #74462

closed

Setting a field to null in an own extension won work with process_datamap()

Added by Klaus Hinum about 8 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
DataHandler aka TCEmain
Target version:
-
Start date:
2016-03-07
Due date:
% Done:

0%

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

Description

Setting eval=null in tca.php of the extension now works in the Typo3 forms, but how can I change or set a value to NULL in my own extension.
Using
$this->tce = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\DataHandling\\DataHandler');
$this->tce->start($data,$cmd,$new_BE_USER);
$this->tce->process_cmdmap();
$this->tce->process_datamap();

where I got a "field" => null in the $data array wont work (sets the field to 0).

Currently I am manually deleting the value with an UPDATE statement, but thats not how its meant to be I guess. Looks like old code from the area before NULL was possible in number fields.

Actions #1

Updated by Nicole Cordes about 8 years ago

  • Status changed from New to Needs Feedback

Hi Klaus,

I'm not sure if I fully understand your problem. Can you please explain again

a) What are you trying to archive
b) How do you try it?
c) What happens instead?

Thank you for your help!

Actions #2

Updated by Klaus Hinum about 8 years ago

I am trying to e.g. write NULL in a database field. The problem is, if I set a variable to NULL and write it to the database using process_datamap(); it is set to 0 altough NULL is allowed and possible in the typo3 backend. I guess there is a separate function to write NULL to the field, but I dont know why NULL and 0 are not differentiated by tce->... functions.
This should cover a) and c), how I try it is the code piece above with $data e.g. set to $data['field'] = null;

Actions #3

Updated by Riccardo De Contardi almost 8 years ago

  • Status changed from Needs Feedback to New
Actions #4

Updated by Susanne Moog about 6 years ago

  • Category set to DataHandler aka TCEmain
Actions #5

Updated by Susanne Moog about 4 years ago

  • Status changed from New to Needs Feedback

Hey, can you check what the backend form sends as post request / to the data handler in that case? as that works, the same thing should work for you.

Actions #6

Updated by Christian Kuhn about 2 years ago

  • Status changed from Needs Feedback to Closed

Hey. I hope it's ok to close here due to lack of further feedback. If this is still a problem, let's restart with a new issue.

Actions

Also available in: Atom PDF