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

Manuel Rego Casasnovas mrego at igalia.com
Wed Jul 23 12:23:56 CEST 2008


Hello,

On Wed, 2008-07-23 at 13:00 +0300, Dmitry Dulepov [typo3] wrote:
> 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.

One question about that, how I can know if a function is internal or
not?

> 
> > 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]).
> > 

The real problem is how to set the optional parameters without call
directly to function copyRecord.
I'd like to call this function like it's called at [1], but I think that
it's not possible. Then I don't understand why this is an internal
function.

Best regards,
   Rego

[1]
http://typo3.org/fileadmin/typo3api-4.0.0/dd/da6/class_8t3lib__tcemain_8php-source.html#l02957


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