TYPO3CMS-Reference-CoreApi
TYPO3CMS-Reference-CoreApi copied to clipboard
DataHandler documentation improvements
process_datamapdoes not exist at all on that page.process_cmdmapexists, but is not really explained- how to get the uid of a new record created with datamap?
- There is a full basic example ("Basic usage") at the top of the page, the other examples in "Examples of data submission" are incomplete (because they only initialize an array and do not pass it to datahandler and have to be combined with the example at the top
https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/Typo3CoreEngine/Database/Index.html
Further information is on this page:
Using the DataHandler in scripts
so the information is actually there.
In the core, there are several examples, in the testing classes, e.g.
typo3/sysext/core/Tests/Functional/DataHandling/DataHandler/SlugUniqueTest.php
$dataHandler = GeneralUtility::makeInstance(DataHandler::class);
//$dataHandler->enableLogging = false;
$dataHandler->start(
[
'pages' => [
3 => [
'title' => 'Page One',
'slug' => 'page-one',
],
],
],
[]
);
$dataHandler->process_datamap();
in gridelements:
$data = [];
$data['tt_content']['NEW234134'] = $dataArray;
$this->getTceMain()->start($data, []);
$this->getTceMain()->process_datamap();