Is there an ez way to display the output of error templates?

Author Message

Steven E. Bailey

Wednesday 09 February 2011 2:18:05 am

I'm trying to test the newly designed error documents and there doesn't seem to be an easy way of displaying the output... (except the module not found/view not found, etc.)

I know I can pretty easily write something to generate errors but does it already exist? Or, am I not thinking of something like a layout/set/error/<number>?

Certified eZPublish developer
http://ez.no/certification/verify/396111

Available for ezpublish troubleshooting, hosting and custom extension development: http://www.leidentech.com

Ahmed Arous

Wednesday 09 February 2011 2:58:25 am

Hi,

Try adding this :

[DebugSettings]

DebugOutput=enabled

Debug=popup

to your settings/override/site.ini.appaend.php

it will generate a popup displaying the errors and worning of the current template every time you load a page.

Steven E. Bailey

Wednesday 09 February 2011 5:57:29 am

Thanks, but that's not what I mean.

What I mean is that I want an easy way to see the templates that I'm overriding:

templates/error/kernel/<error number>.tpl

Certified eZPublish developer
http://ez.no/certification/verify/396111

Available for ezpublish troubleshooting, hosting and custom extension development: http://www.leidentech.com

Marko Žmak

Friday 11 February 2011 8:48:51 am

Steven, I believe this INI settings is what you are looking for:

http://doc.ez.no/eZ-Publish/Technical-manual/4.x/Reference/Configuration-files/site.ini/TemplateSettings/ShowUsedTemplates

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Steven E. Bailey

Friday 11 February 2011 12:14:29 pm

No, I didn't want the list of used templates. What I meant is something that would display the output of the error templates - a way of generating a fake error condition.

What I did was write a one module, one view extension that just passes the error number to the error handler - I was just hoping that there was some easy way of doing this, I mean, I'm sure I'm not the first person who ever wanted to test error templates.

<?php

/*
# The following error codes for kernel is currently defined
# 1  - Access denied
# 2  - Object not found
# 3  - Object not available
# 20 - Module not found
# 21 - Module view not found
# 22 - Module or view disabled
# 50 - No DB connection
*/

$Module  = $Params['Module'];
$errorId = $Params['errorId'];
return $Module->handleError( $errorId );

?>

Edit - (D'oh) there is an easy way, all I needed to do was go to:

error/view/kernel/<error number>

error/view/shop/<error number>

Certified eZPublish developer
http://ez.no/certification/verify/396111

Available for ezpublish troubleshooting, hosting and custom extension development: http://www.leidentech.com

Marko Žmak

Sunday 13 February 2011 4:49:24 am

Steven, if you have used the ini settings I mentioned I believe you could have found your solution in less than a minute.

By enabling "ShowUsedTemplates" (together with enabling DebugOutput) you would get at the bottom of the page a list of templates that are used to render your view, right?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 05:10:50
Script start
Timing: Jan 18 2025 05:10:50
Module start 'layout'
Timing: Jan 18 2025 05:10:50
Module start 'content'
Timing: Jan 18 2025 05:10:50
Module end 'content'
Timing: Jan 18 2025 05:10:50
Script end

Main resources:

Total runtime0.7343 sec
Peak memory usage4,096.0000 KB
Database Queries68

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 588.1719152.6563
Module start 'layout' 0.00520.0028 740.828139.5156
Module start 'content' 0.00800.7248 780.3438624.3828
Module end 'content' 0.73290.0014 1,404.726616.0938
Script end 0.7343  1,420.8203 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.5075160.0002
Check MTime0.00180.2458160.0001
Mysql Total
Database connection0.00070.100910.0007
Mysqli_queries0.674791.8812680.0099
Looping result0.00070.0941660.0000
Template Total0.706496.220.3532
Template load0.00210.279620.0010
Template processing0.704395.915320.3522
Template load and register function0.00010.012410.0001
states
state_id_array0.00110.153210.0011
state_identifier_array0.00090.115920.0004
Override
Cache load0.00160.2186380.0000
Sytem overhead
Fetch class attribute can translate value0.00050.072630.0002
Fetch class attribute name0.00120.159380.0001
XML
Image XML parsing0.00110.146230.0004
class_abstraction
Instantiating content class attribute0.00000.0029110.0000
General
dbfile0.00090.1231250.0000
String conversion0.00000.001440.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 27
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs