Bug #14945
closedBE: TCEMAIN.clearCacheCmd doesn't work when deleting records
0%
Description
Page TSConfig TCEMAIN.clearCacheCmd = pid#1, pid#2, ... , pid#n works only inserting new records or updating existing records.
IMHO,
this issue is related with: t3lib_BEfunc::getRecord.
As a matter of fact, when deleting a record, method 'deleteRecord' from class t3lib_TCEmain is used.
At the end of 'deleteRecord' another method of t3lib_TCEmain is used: '$this->clear_cache($table,$uid)'.
'$this->clear_cache($table,$uid)' calls 't3lib_BEfunc::getTSCpid'.
't3lib_BEfunc::getTSCpid' consequently uses 't3lib_BEfunc::getTSconfig_pidValue', which calls
't3lib_BEfunc::getRecord'.
Finally: in t3lib_BEfunc::getRecord there's a 'where' clause with 't3lib_BEfunc::deleteClause($table)', complete line:
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields, $table, 'uid='.intval($uid).t3lib_BEfunc::deleteClause($table).$where);
So, when a record is deleted '$this->clear_cache($table,$uid)' and subsequent are called after SQL statement which marks a record as deleted.
t3lib_BEfunc::getRecord returns -1 because it can't find a record just deleted!
At this moment i solved (just to make it work!) inserting '$this->clear_cache($table,$uid)' before SQL statement, but i don't like it at all!!
Any idea to solve it better ?
(issue imported from #M1407)
Files