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

Manuel Rego Casasnovas mrego at igalia.com
Wed Jul 23 11:52:21 CEST 2008


Hello,

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);

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();

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(...);

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".

I guess that I'm missing something, but I don't know what.

Any idea to fix my problem?

Thank you very much,
   Rego

[1]
http://typo3.org/fileadmin/typo3api-4.0.0/d8/d46/classt3lib__TCEmain.html#6b1370718f86c53a38b761b229f1787e
[2]
http://typo3.org/fileadmin/typo3api-4.0.0/dd/da6/class_8t3lib__tcemain_8php-source.html#l02135

-- 
Manuel Rego Casasnovas
Computer Science Engineer
mailto:mrego at igalia.com
Tel: +34 986 10 76 10
Fax: +34 981 91 39 49
Igalia - http://www.igalia.com


More information about the TYPO3-english mailing list