diff options
author | mkanat%bugzilla.org <> | 2009-11-23 07:37:01 +0100 |
---|---|---|
committer | mkanat%bugzilla.org <> | 2009-11-23 07:37:01 +0100 |
commit | c4b313b45914fd0a98dd23e485b778f092e9ba3b (patch) | |
tree | 8952393c8f57f424714d1d5a14ba10635b9e5131 /Bugzilla/Template.pm | |
parent | eea9be3a4f613ba827d9f7f4a01611c1ae176306 (diff) | |
download | bugzilla-c4b313b45914fd0a98dd23e485b778f092e9ba3b.tar.gz bugzilla-c4b313b45914fd0a98dd23e485b778f092e9ba3b.tar.xz |
Bug 523999: New Hook: template-before_create
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> (module owner) a=mkanat
Diffstat (limited to 'Bugzilla/Template.pm')
-rw-r--r-- | Bugzilla/Template.pm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index 17429a2e2..b61d28bc7 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -36,6 +36,7 @@ use strict; use Bugzilla::Bug; use Bugzilla::Constants; +use Bugzilla::Hook; use Bugzilla::Install::Requirements; use Bugzilla::Install::Util qw(install_string template_include_path include_languages); @@ -470,7 +471,7 @@ sub create { # IMPORTANT - If you make any configuration changes here, make sure to # make them in t/004.template.t and checksetup.pl. - return $class->new({ + my $config = { # Colon-separated list of directories containing templates. INCLUDE_PATH => [\&getTemplateIncludePath], @@ -797,8 +798,12 @@ sub create { return \@optional; }, }, + }; - }) || die("Template creation failed: " . $class->error()); + Bugzilla::Hook::process('template-before_create', { config => $config }); + my $template = $class->new($config) + || die("Template creation failed: " . $class->error()); + return $template; } # Used as part of the two subroutines below. |