Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.3.0a1

Request #9753 Template rendering fails silently if invalid root supplied
Submitted: 2007-01-05 20:04 UTC Modified: 2007-12-10 10:03 UTC
From: pear-bug at andywaite dot com Assigned: dsp
Status: Assigned Package: HTML_Template_IT (version 1.2.1)
PHP Version: 4.4.4 OS: Mac OS X 10.4, probably others
Roadmaps: (Not assigned)    
Subscription  
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes. If this is not your bug, you can add a comment by following this link. If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: pear-bug at andywaite dot com
New email:
PHP Version: Package Version: OS:

 

 [2007-01-05 20:04 UTC] pear-bug at andywaite dot com (Andy Waite)
Description: ------------ As summary. 'badpath' refers to a path on the system which does not exist or is otherwise invalid. Test script: --------------- require_once "HTML/Template/IT.php"; $template = new HTML_Template_IT("./badpath"); $template->loadTemplatefile("test.tpl", false, true); $template->setCurrentBlock("TESTBLOCK"); $template->setVariable("TESTPLACEHOLDER", "test"); $template->parseCurrentBlock(); $template->show(); Expected result: ---------------- An error/message reporting that 'badpath' does not exist. Actual result: -------------- Template renders as blank.

Comments

 [2007-01-05 20:05 UTC] pear-bug at andywaite dot com
(correcting summary)
 [2007-12-10 09:41 UTC] someone3x7 (Joesph C. de Bast)
This isn't the only silent error. However, after a few hours of trying to figure why some templates work and others don't and not finding anything I've given up on this package.
 [2007-12-10 10:03 UTC] dsp (David Soria Parra)
Hi, I guess it fails silencly because IT is PHP4 and therefore cannot use exceptions as needed to throw errors from a constructor. We will change this in ITx2, but no in the current 1.2 branch.
 [2008-01-10 03:27 UTC] najtje (Tomasz Cichecki)
You might want to look at: http://pear.php.net/manual/en/core.pear.pear.seterrorhandling.php BTW: Try this: <?php require_once('HTML/Template/IT.php'); PEAR::setErrorHandling(PEAR_ERROR_DIE); $t = new HTML_Template_IT(); $t->loadTemplateFile('doesnotexist.tpl'); $t->touchBlock('__global__'); $t->show(); ?>