Issue Bug Closed

#24406error when using t3lib_TCEmain->clear_cacheCmd in frontend

Krystian Szymukowicz 12/23/10, 17:43 updated 11/09/11, 11:41

Description

PROBLEM:

in rev. 8481 there has been added writelog when clearing the cache.

public function clear_cacheCmd($cacheCmd) {

$this->BE_USER->writelog(……….

But some extesions like Dmitry Dulepov ‘comments’ are using ‘clear_cacheCmd’ from frontend where $this->BE_USER is not initialised.

So we get:
Fatal error: Call to a member function writelog() on a non-object in T:\workspace-typo3\typo3\typo3_src-svn-trunk\t3lib\class.t3lib_tcemain.php on line 6761

SOLUTION:

Check if we are in BE mode while writing the log.

if (TYPO3_MODE === ‘BE’) {
$this->BE_USER->writelog(….
}

(issue imported from #M16832)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.