[TYPO3-dev] Passing a value to a userfunction

Dmitry Dulepov dmitry at typo3.org
Mon Dec 4 16:04:12 CET 2006


Hi!

Georg Ringer wrote:
> Hello,
> 
> I've got a problem with a variable in a user function:
> I call it with this code:
> pidInList.cObject = USER
> pidInList.cObject {
>     userFunc = user_getpages->main
>     treeDepth = 3

You will get the above as $conf['treeDepth'].

>     #page = 14,21,22
>     #page.cObject = TEXT
>     #page.cObject.value 14,21,22
>     #page.data = register:meineID

You will get the above as text entries in nested array, i.e.:

	$conf['page'] = '14';
	$conf['page.'] => array(
		'cObject' => 'TEXT',
		'cObject.' => array(
			'value' => '14,21,22',
			'data' => 'register:meineID'
		)
	);

This happens because typo3 treats these custom properties as such and 
passes them as is. If you look to TSRef, you will find that USER has no 
"page" property, which you expected to be cObject. So typo3 will not 
make it cObject and what you planned. You have to do it yourself if you 
want.

Even more, configuration is passed by value to USER, so you cannot get 
values back from USER in its config.

-- 
Dmitry Dulepov

Web: http://typo3bloke.net/
Skype: callto:liels_bugs

"It is our choices, that show what we truly are,
far more than our abilities." (A.P.W.B.D.)




More information about the TYPO3-dev mailing list