On Wed Feb 13 17:32:28 2008, MKANAT wrote:
Show quoted text> We just created a custom Parser class for Bugzilla, and discovered
> that
> our constants disappeared when we did it. This is apparently because
> Template->_init doesn't do things in the right order.
>
> You can see what we had to do to fix it, here, which also explains the
> bug fairly nicely:
>
>
https://bugzilla.mozilla.org/attachment.cgi?id=303127&action=diff#../head/Bugzilla/Template.pm_sec2
Thanks for the info. I can see the problem you're having and the
solution you've implemented seems adequate for your purposes. However,
I don't think it's something I can feed back into TT2 because it changes
a key behaviour. That is, it always forces a parser object to be loaded
and created. Although it's not widely documented, you can run TT using
pre-compiled templates only. In this case the parser is never loaded
(and can actually be left off the system entirely if a particularly
rigid security policy requires it, for example). Your implementation
changes that to always load and instantiate a parser regardless.
So I think I'll have to reject the change for TT2 in order to maintain
the status quo. But I'll certainly improve the initialisation code in
TT3 so that you don't have to jump through the extra hoop when it comes
to subclassing.
Cheers
Andy