Subject: | PATCH - don't die if INCLUDE file doesn't exist |
Hello,
this is a PATCH proposal in case included template doesn't exist. In
such case, don't die, but use Carp::clunk to silently report such failure.
Some text like: "Unable to include 'foo.tmpl'" or whatever you like
could be also inserted. Make such behavior as optional(= make an option
for it) would be useable.
Reason for this patch is I'm including templates generated by
application back-end and although improbably, it might just happen they
are gone. However, this breaks whole web application in case you're
using tree-like template hierarchy ~ index.tmpl which includes other
.tmpl files based on conditions.
What I also fail to understand is why HTML::Template tries to include
everything even I put INCLUDE into IF. My point is IF condition isn't
fulfilled, then don't include template. Don't even care about if it does
or doesn't exist. However, this is not the case. It seems
HTML::Template includes everything and every time and this means even
nested includes up to N levels bellow.
So, if template is missing at N-th level, your whole applications goes
"belly up".
Since there are so many bugs open, I'm not giving this a big chance to
get implemented nor get any feed back at all. However, somebody else
might find it useful.
I do. I don't like my applications die just because of one file.
I've also tried to catch it in application itself, however since this is
site-wide issue, I won't.
Take care,
Zdenek
Subject: | Template.pm.patch-include |
Message body not shown because it is not plain text.