diff options
Diffstat (limited to 'Bugzilla/Template.pm')
-rw-r--r-- | Bugzilla/Template.pm | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index b4e0dcb90..800536cd5 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -35,6 +35,7 @@ package Bugzilla::Template; use strict; use Bugzilla::Constants; +use Bugzilla::Install::Requirements; use Bugzilla::Util; use Bugzilla::User; use Bugzilla::Error; @@ -57,7 +58,6 @@ use base qw(Template); # (which is how Perl implements constants) and ignoring the rest (which, if # Constants.pm exports only constants, as it should, will be nothing else). sub _load_constants { - use Bugzilla::Constants (); my %constants; foreach my $constant (@Bugzilla::Constants::EXPORT, @Bugzilla::Constants::EXPORT_OK) @@ -820,6 +820,16 @@ sub create { Bugzilla::BugMail::Send($id, $mailrecipients); }, + # These don't work as normal constants. + DB_MODULE => \&Bugzilla::Constants::DB_MODULE, + REQUIRED_MODULES => + \&Bugzilla::Install::Requirements::REQUIRED_MODULES, + OPTIONAL_MODULES => sub { + my @optional = @{OPTIONAL_MODULES()}; + @optional = sort {$a->{feature} cmp $b->{feature}} + @optional; + return \@optional; + }, }, }) || die("Template creation failed: " . $class->error()); |