[TYPO3-dev] Deleting record several places?

Simon Justesen simon at simm.removedk
Mon Jan 5 03:47:27 CET 2009


Simon Justesen skrev:
> Georg Großberger skrev:
>> Martin Kutschker schrieb:
>>> Simon Justesen schrieb:
>>>> Hi,
>>>>
>>>> Short question:
>>>>
>>>> I need to maintain two tables so that when I delete a record in
>>>> list-view belonging to my extension it is also deleted in another 
>>>> table.
>>>> How can I do that?
>>>
>>> I think that there is a hook in TCEmain for delete operations.
>>>
>>> Masi
>>
>> Take a look at the process_cmdmap method in 
>> t3lib/class.t3lib_tcemain.php.
>>
>> There you find the hook 
>> $TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'] 
>>
>>
>>
>>
> 
> Thanks guys! I think I got it :D
> 
> Simon


I cannot get the hook to respond - wrote a little test and I've tried 
both pre and postprocess.

class user_produktliste_hooks {
function processCmdmap_preProcess($command, &$table, &$id, &$value, &$pObj)
	{
	
		if ($table == 'tx_produktliste_produktliste' && $command == 'delete')
		{
		t3lib_div::sysLog('produktliste','preProcess was called');
		}
		
	}
}

Contents of ext_localconf.php:
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'][] 
= 
'typo3conf/ext/produktliste/class.tx_produktliste_tcemainprocdm.php:user_produktliste_hooks';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmap_preProcess'][] 
= 
'typo3conf/ext/produktliste/class.tx_produktliste_tcemainprocdm.php:user_produktliste_hooks';

Nothing gets written, and there are no errors.

Thanks,

Simon




More information about the TYPO3-dev mailing list