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

Request #9753 Template rendering fails silently if invalid root supplied
Submitted: 2007-01-06 01:04 UTC
From: pear-bug at andywaite dot com Assigned: gregorycu
Status: Wont fix 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  


 [2007-01-06 01: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-06 01:05 UTC] pear-bug at andywaite dot com
(correcting summary)
 [2007-12-10 14: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 15: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 08: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(); ?>
 [2010-03-01 17:14 UTC] gregorycu (Gregory Currie)
-Assigned To: dsp +Assigned To: gregorycu
 [2010-06-08 00:18 UTC] gregorycu (Gregory Currie)
-Status: Assigned +Status: Wont fix