[TYPO3-core] RFC #17725 Cleanup: Wrong check for FE / BE context in class.t3lib_tstemplate.php

Bjoern Pedersen bjoern.pedersen at frm2.tum.de
Thu Feb 24 16:01:50 CET 2011


Am 24.02.2011 15:33, schrieb Ernesto Baschny [cron IT]:
> Rens Admiraal schrieb am 23.02.2011 19:43:
>> Hi,
>>
>> this is a SVN patch request.
>>
>> Type: Cleanup / no brainer
>>
>> Bugtracker references:
>> http://bugs.typo3.org/view.php?id=17725
>>
>> Branches: 4.5.1
>>
>> I ran into a wrong check for the frontend / backend context in
>> class.t3lib_tstemplate.php. It uses:
>>     if (is_object($GLOBALS['TSFE']))
>>
>> as check instead of:
>>     if (TYPO3_MODE == 'FE')
>>
> 
> Any way to reproduce this particular bug? To me its not a "no brainer"
> if I cannot see what will be fixed with this change. :)
> 
> E.g. I can imagine that I could have a $GLOBALS['TSFE'] also in BE
> context, and your change would break this situation (just a thought).
> 
> Cheers,
> Ernesto
> 

It will make a difference (at least regarding the function calls) during
FE-editing. That seems (from a quick grep) the only case in core where
TSFE is initialized in BE mode.

Comment from page->versionOL:
        /**
         * Versioning Preview Overlay
         * ONLY active when backend user is previewing records. MUST
NEVER affect a site served which is not previewed by backend users!!!
         * Generally ALWAYS used when records are selected based on uid
or pid. If records are selected on other fields than uid or pid (eg.
"email = ....") then usage might produce un
desired results and that should be evaluated on individual basis.
         * Principle; Record online! => Find offline?


So probably this check is done thie way on purpose. Mayb a comment would
be helpful.

Björn


More information about the TYPO3-team-core mailing list