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.