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

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

eZ debug

Timing: Jan 18 2025 02:19:12
Script start
Timing: Jan 18 2025 02:19:12
Module start 'content'
Timing: Jan 18 2025 02:19:13
Module end 'content'
Timing: Jan 18 2025 02:19:13
Script end

Main resources:

Total runtime1.2111 sec
Peak memory usage4,096.0000 KB
Database Queries205

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0072 587.9688180.8047
Module start 'content' 0.00721.0848 768.7734629.4922
Module end 'content' 1.09200.1191 1,398.2656341.0234
Script end 1.2111  1,739.2891 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00440.3613210.0002
Check MTime0.00160.1327210.0001
Mysql Total
Database connection0.00100.084410.0010
Mysqli_queries1.123192.73062050.0055
Looping result0.00220.18112030.0000
Template Total1.180497.520.5902
Template load0.00290.238420.0014
Template processing1.177597.224320.5888
Template load and register function0.00010.007110.0001
states
state_id_array0.00080.066210.0008
state_identifier_array0.00090.074720.0005
Override
Cache load0.00220.1817380.0001
Sytem overhead
Fetch class attribute can translate value0.00110.093940.0003
Fetch class attribute name0.00210.171080.0003
XML
Image XML parsing0.00140.118540.0004
class_abstraction
Instantiating content class attribute0.00000.0016110.0000
General
dbfile0.00300.2447360.0001
String conversion0.00000.000530.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 27
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs