[TYPO3] Duplicated referencend $tce->copyRecord function with templavoila

Dmitry Dulepov [typo3] dmitry at typo3.org
Wed Jul 23 12:00:36 CEST 2008


Hi!

Manuel Rego Casasnovas wrote:
> I've a problem when I use the method localize with the next code:
> $tce = t3lib_div::makeInstance('t3lib_TCEmain');
> $tce->start(array(),array());
> $tce->localize('tt_content', 37, 1);

localize() function is internal and should not be called directly.

> The problem is that a new reference to the translated content is added
> on field "tx_templavoila_flex" of table "pages".
> 
> But I don't have this reference if I use a link like to translate the
> record:
> typo3/tce_db.php?&cmd[tt_content][37][localize]=1
> 
> I've fixed this fist problem configuring properly the TCE instance:
> $tce = t3lib_div::makeInstance('t3lib_TCEmain');
> $cmd['tt_content'][37]['localize'] = 1;
> $tce->start($cmd),array());
> $tce->process_cmdmap();

This is correct way.

> However the real problem at this moment is related with function
> copyRecord. The same case than with localize, I tried to use:
> $tce = t3lib_div::makeInstance('t3lib_TCEmain');
> $tce->start(array(),array());
> $tce->copyRecord(...);

Again, this function is internal. You should never call it directly. You must use process_datamap() or process_cmdmap(). Other function are likely to become protected soon.

> And I can't solve the problem configuring properly $cmd array because I
> need to use the optional params overrideValues and excludeFields [1] of
> function copyRecord, and when cmd is processed these optional params are
> not used (see [2]).
> 
> I need to use the method because I'd like to call this function with
> more than one record to automatize the process, however for every record
> that I copy with $tce->copyRecord function a new reference appears on
> field "tx_templavoila_flex".

You can use process_* functions with more than one record.

-- 
Dmitry Dulepov
TYPO3 Core team
More about TYPO3: http://typo3bloke.net/
Subscribe: http://typo3bloke.net/rss.xml
Latest article: http://typo3bloke.net/post-details/howto_use_frontend_user_data_in_a_typo3_mailform/


More information about the TYPO3-english mailing list