[TYPO3-english] Passing a value from TS to userfunc for SQL: value={field:uid}

Bert Hiddink [BENDOO e-work solutions] hiddink at bendoo.nl
Tue Dec 2 15:07:23 CET 2014


Hello,

Having a hard time understanding why I can not pass a value with 
value:{field:uid} to a SQL-statement within a userfunc.

Please see below. If I hardcode "selectedUid.value=654", the SQL gives 
the expected result. However, if I use "selectedUid.value={field:uid}", 
the SQL returns nothing, not even 0, that is, makes the statement 
invalid IMHO.

If I print $selectedUid.value, it shows "654". However, is seems not 
compatible with the SQL...

Any ideas?

Thanks in advance!

Regards,
Bert


############ TS #############

           35 = USER
           35 {
             userFunc = user_counter->getCounter
             userFunc {
               selectedCategories=TEXT 
selectedCategories.data=GP:tx__pi1|overwriteDemand|categories
               selectedUid=TEXT
               ######## Does work ###########
               selectedUid.value=654
               ######## Does not work!!!##################
#              selectedUid.value={field:uid}
              selectedPid={$categoriesPid}

             }
           }

############ USERFUNC #############


	$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
		'count(*) as counter',
		'(SELECT p3.uid, group_concat(mm3.uid_local)
		  FROM sys_category_record_mm mm3
		  INNER JOIN tx_legamaster_domain_model_legamaster p3 ON 
mm3.uid_foreign=p3.uid
		  INNER JOIN sys_category c ON c.uid=mm3.uid_local
		  WHERE p3.pid='.$selectedPid.' AND p3.deleted=0 and p3.hidden=0 and 
mm3.uid_local in ('.$selectedCategories.')
		  AND p3.sys_language_uid='.$currentLanguage.' AND 
c.sys_language_uid='.$currentLanguage.' group by mm3.uid_foreign
		  having count(distinct mm3.uid_local) >= '.$countedCategories.'
		 ) as products',
		'',
		'',
		'',
		''
	);


More information about the TYPO3-english mailing list