Project

General

Profile

Actions

Bug #14945

closed

BE: TCEMAIN.clearCacheCmd doesn't work when deleting records

Added by Robert von almost 19 years ago. Updated almost 18 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2005-08-26
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
3.8.0
PHP Version:
4
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

bug_1407.diff (413 Bytes) bug_1407.diff Administrator Admin, 2005-09-10 19:59
2005-10-20_bugfix_1407.patch (920 Bytes) 2005-10-20_bugfix_1407.patch Administrator Admin, 2005-10-20 15:04
Actions

Also available in: Atom PDF