[Typo3-dev] How does passthrough in tca work??

Irene Höppner irene.hoeppner at diacc.de
Sun Jul 25 18:07:59 CEST 2004


Hi,

>  The key lies in this sentence:
>  [quote]
>  But still the update gets logged and the history/undo function will
>  work with such values.
>  [/quote]

There is another interisting sentence to understand what happens: '...the
fields are not editable through TCEforms, just able to manipulate through
TCE directly.'

If you have a look at the mentioned example direct mail, you'll find some
interesting lines of code in class.mod_web_dmail.php:
mod_web_dmail->cmd_displayPageInfo().
'module_sys_dmail_category' is a field with TCA-type 'passthrough'.
Let's see, what happens:

First, something is done with the value of 'module_sys_dmail_category':
$data["tt_content"][$recUid]["module_sys_dmail_category"]= pow (2,$k);
Then t3lib_TCEmain is instanciated:
$tce = t3lib_div::makeInstance("t3lib_TCEmain");
initialized:
$tce->start($data,Array());
and the function process_datamap() is called:
$tce->process_datamap();

t3lib_TCEmain->process_datamap() takes care of things like:
- check permissions,
- check TCA (if a field is not defined in the TCA, it will not be processed)
- write the log
- set fields like crdate, cruser_id, tstamp
- and, in the end, update/insert the database

That means, without TCA-definition for the field 'module_sys_dmail_category'
the field would never be updated, with another type than passthrough
backend-users could change the field via the backend, which is probably not
wanted by the extension author.

That's the way, I understand it...

Greets, Irene

-- 
DIACC GmbH
http://www.diacc.de/






More information about the TYPO3-dev mailing list