[TYPO3-core] RFC #16832: Bug: error when using t3lib_TCEmain->clear_cacheCmd in frontend
Søren Malling
soren.malling at gmail.com
Sat Dec 25 19:42:59 CET 2010
This is not a review but a comment on this RFC:
IIRC tcemain is not meant to be used frontend? But, if it is, there
should be the same condition for each and every function in tcemain
using a backend(-user) related function!
Maybe a function/possibility of clearing cache from frontend should be
introduced to a different class (t3lib_div?)?!
Regards
Søren
On Saturday, December 25, 2010, Krystian Szymukowicz <t33k at prolabium.com> wrote:
> Hi,
>
>
>
> This is an SVN patch request.
>
> Type: Bugfix
>
> BT reference: http://bugs.typo3.org/view.php?id=16832
>
> Branches: trunk
>
>
>
>
> 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(....
> }
>
>
> --
> grtz
> Krystian Szymukowicz
>
--
Søren Malling
TYPO3 Brugergruppe Danmark: www.typo3danmark.dk
Twitter: twitter.com/sorenmalling
More information about the TYPO3-team-core
mailing list