eZ Community » Forums » Developer » Debug disabled only on a certain...
expandshrink

Debug disabled only on a certain modules view

Debug disabled only on a certain modules view

Wednesday 19 May 2010 1:26:04 pm - 5 replies

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,

Wednesday 19 May 2010 2:14:56 pm

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();

Thursday 20 May 2010 9: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...

Modified on Thursday 20 May 2010 9:19:05 am by Gaetano Giunta

Thursday 20 May 2010 10: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".

Modified on Wednesday 14 July 2010 11:51:22 am by H-Works Agency

Wednesday 14 July 2010 12:12:41 pm

with this on top of your view ?

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

Wednesday 14 July 2010 9:28:05 pm

Great this time its working ! Thanx a lot.

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from