[TYPO3-dev] Debug / Testing / more verbose TCEmain
Jigal van Hemert
jigal.van.hemert at typo3.org
Wed Aug 3 14:33:53 CEST 2016
Hi,
On 02/08/2016 01:46, Nicolai Brogaard wrote:
> I am trying to insert localized content into tt_content using TCEMain
> (DataHandler)
>
> I am running version 6.2.12
>
> I start with the [version] command and that works great.
>
> I then reset the TCE object and try using the [localize] - it doesn't
> work; I don't get any error either - actually any kind of verbosity
> would be appreciated - is there a way I can force that?
You don't need to unset the DataHandler (TCE_main) object in between
operations. Calling ->start() will initialize the object enough to work
with the new command or data array.
Some commands will create new records (version, localize, NEW record in
the data map) and you need to use the uid's of those records to modify
those records.
So, if you execute the localize command a new record is created. For
most tables it's a record in the same table, for pages for example it's
a record in the overlay table.
Once you've called start() it's no use changing the data in the array.
Those changes will not be used in process_datamp() and process_cmdmap()
process_cmdmap() will do what's in the second parameter of start(): the
commands
process_datamap() will do what's in the first parameter of start(): the
new or modified data
So the order is:
- fill data or command array
- call ->start()
- call process_data/cmdmap
In your case:
- fill command array (version and localize can be in one array)
- call start()
- call process_cmdmap()
- find localized record
- fill data array and empty command array
- call start()
- call process_datamap()
--
Jigal van Hemert
TYPO3 CMS Active Contributor
TYPO3 .... inspiring people to share!
Get involved: typo3.org
More information about the TYPO3-dev
mailing list