[TYPO3-core] RFC: #12614: Debug output destroys BE HTML

Susanne Moog typo3 at susanne-moog.de
Tue Mar 2 14:38:05 CET 2010


Hey Ivan, hey all,

Ivan Kartolo wrote:
> Hi Rupert,
> 
>> patch doesn't appy here:
>>
>> **** malformed patch at line 29: Index: t3lib/class.t3lib_div.php
>>
>> did you edit it by hand?
>>
> 
> just make a new one againt Trunk Rev. 6446
> 
>> besides this, hardcoding the flashmessages for BE debugging of sql
>> errors is not a good idea. I use cc_debug to debug stuff in the BE which
>> will not be called anymore after your patch.
> 
> you're right. I just reverted the debug function in t3lib_db class. The
> con is: SQL-Error will be shown as an info flashmessage, because it's
> currently "hardcoded" in the debug-function (t3lib_div).

I like the flashmessage approach for the backend but unfortunately the
patch does not work for frontend debug messages. t3lib_div::debug is
also called from the frontend but the rendering of flashmessages works
only with a valid backend user. See t3lib_flashmessagequeue:

protected static function getFlashMessagesFromSession() {
  $flashMessages =
$GLOBALS['BE_USER']->getSessionData('core.template.flashMessages');
return is_array($flashMessages) ? $flashMessages : array();
	}


This results in a fatal error in the frontend after applying the patch
as $GLOBALS['BE_USER'] is not set.

"Fatal error: Call to a member function getSessionData() on a non-object
in /var/www/t3lib/class.t3lib_flashmessagequeue.php on line 94"

So we either need a way to render flashmessages in the frontend or we
could check if we are in the frontend or backend and use the current
behavior in case of frontend.

Best regards,

Susanne


More information about the TYPO3-team-core mailing list