How templates hooks are suppose to work?

Tiago timello at
Wed Sep 12 14:24:04 UTC 2007

Hi guys,

I'm experiencing some problems with Bugzilla template hooks.

Here are some points:

1. I cannot make it work as described in the documentation
( It says the
templates for the hooks need to be located in
but it only works if we remove the hook directory from the structure
and looking at the code we really miss the 'hook' in the
Template::Plugin::Hook line:


my $extensiontemplate =
my @extensions = glob(bz_locations()->{'extensionsdir'} . "/*");
my @usedlanguages = getLanguages();
foreach my $extension (@extensions) {
    foreach my $language (@usedlanguages) {
        my $file = $extension.'/template/'.$language.'/'.$extensiontemplate;
        if (-e $file) {

Then, it expects something like:
where 'end' is the name of the hook in the template

2. If I use the structure in the
BUGZILLA_ROOT/template/en/extension/... the complains
and show the error message:

file error - hook/global/useful-links.html.tmpl/end/foo.html.tmpl: not found

On this structure it only works if you put it in:
as well as in the custom directory.

My questions are:

1. How exactly the hooks for templates are suppose to work?
2. Why does the directory BUGZILLA_ROOT/template/en/extension exist?
Why complains if we put something there?
3. Can you help me indentify the bugs we have here?

Thank you very much in advance,

Tiago - timello

More information about the developers mailing list