[TYPO3-dev] Is $this->pi_USER_INT_obj a conceptional mistake

Elmar Hinz elmar.DOT.hinz at team.MINUS.red.DOT.net
Sat Aug 12 16:51:22 CEST 2006


Hello,

it is recommended to set $this->pi_USER_INT_obj = 1; for USER INT objects.

This has two effects:

1.) it supresses the no_cache parameter in links (if argument $cache is 0)
2.) it supresses the cHash parameter in links (if argument $cache is 0)

function pi_linkTP($str,$urlParameters=array(),$cache=0,$altPageId=0)	{
	$conf=array();
	$conf['useCacheHash'] = $this->pi_USER_INT_obj ? 0 : $cache;
	$conf['no_cache'] = $this->pi_USER_INT_obj ? 0 : !$cache;
	$conf['parameter'] = $altPageId ? $altPageId : ($this->pi_tmpPageId ?
$this->pi_tmpPageId : $GLOBALS['TSFE']->id);
	$conf['additionalParams'] =
$this->conf['parent.']['addParams'].t3lib_div::implodeArrayForUrl('',$urlParameters,'',1).$this->pi_moreParams;

	return $this->cObj->typoLink($str, $conf);
}


Obviously in times before USER_INT the argument $cache of the link function
has triggert the no_cache parameter. no_cache has become depreciated by the
non cached USER_INT objects.

Later $this->pi_USER_INT_obj = 1 was invented to simply migrate old style
plugins to USER_INT, with a lot of alterations. Set it and no_cache is gone.

Unfortunatly $this->pi_USER_INT_obj = 1 prevents creation of the cHash
parameter. This is only fine as long as the link sends parameters for the
same USER_INT plugin wich is never cached. It becomes disturbing if the
link sends parameters for an external plugin/page which should be cached.

I think a general $this->pi_USER_INT_obj = 1 parameter is a conceptual
mistake  because not every link generated with the pi_-link functions
points back to the plugin.

I propose to remove the no_cache parameter from the pi_linkTP() function
completely and to remove the $this->pi_USER_INT_obj setting with it.

In the rare case a complete page shouldn't be cached, you can configure
that with TS for that page.

What do you think?


Regards

Elmar






























More information about the TYPO3-dev mailing list