Forums / Developer / Debug disabled only on a certain modules view

Debug disabled only on a certain modules view

Author Message

H-Works Agency

Wednesday 19 May 2010 4:26:04 am

Hello,

Is there a php directive that allow to disable debug output on a custom module view ?

Debug would be activated with regular process, but not a certain modules view.

Would be a great help for developers whom use customs views for ajax queries.

Regards,

EZP is Great

André R.

Wednesday 19 May 2010 5:14:56 am

This is how ezjscore handles it (and ezoe for it's ajax views as well, but without using view parameter to conditionally enable it):

$debugOutput    = isset($Params['debug']) ? $Params['debug'] : false;
if ( $debugOutput && ( $contentType === 'xml' || $contentType === 'xhtml' ) )
{
    echo "<!--\r\n";
    eZDebug::printReport( false, false );
    echo "\r\n-->";
}
else if ( $debugOutput && $contentType === 'json' )
{
    echo "/*\r\n";
    eZDebug::printReport( false, false );
    echo "\r\n*/";
}
eZDB::checkTransactionCounter();
eZExecution::cleanExit();

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Gaetano Giunta

Thursday 20 May 2010 12:18:40 am

A simpler, albeit hackish way, is to use this tag in the pagelayout template that you will conditionally apply to your views:

<!-- <!--DEBUG_REPORT--> -->

Btw, the printing of that data should definitely be passed out to a customizable handler...

Principal Consultant International Business
Member of the Community Project Board

H-Works Agency

Thursday 20 May 2010 1:15:53 am

Hello

Those directives doesn't work, if i add : eZDebug::printReport( false, false ) this just output an ezdebug object and my content is not returned anymore.

My question was "In a custom module view, how to disable debug output if debug is enabled else where".

EZP is Great

Yannick Komotir

Wednesday 14 July 2010 3:12:41 am

with this on top of your view ?

eZDebug::updateSettings(array(
    "debug-enabled" => false,
    "debug-by-ip" => false
));

<|- Software Engineer @ eZ Publish developpers -|>
@ http://twitter.com/yannixk

H-Works Agency

Wednesday 14 July 2010 12:28:05 pm

Great this time its working ! Thanx a lot.

EZP is Great