summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2016-05-16 17:23:19 +0200
committerDavid Lawrence <dkl@mozilla.com>2016-05-16 17:23:32 +0200
commitc5a676ad9f8e3d82e3ae27087114c321204ee0d5 (patch)
treec99bc7d44a77ee1db7225302bea23b178359efae /Bugzilla
parent2db8904f0e386e0bc872cd3f6d7f843fd2068bbe (diff)
downloadbugzilla-c5a676ad9f8e3d82e3ae27087114c321204ee0d5.tar.gz
bugzilla-c5a676ad9f8e3d82e3ae27087114c321204ee0d5.tar.xz
Bug 1261114 - Release notes cannot be displayed due to missing REQUIRED_MODULES and OPTIONAL_MODULES
r=dylan
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Template.pm32
1 files changed, 23 insertions, 9 deletions
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm
index 49294244a..40079339a 100644
--- a/Bugzilla/Template.pm
+++ b/Bugzilla/Template.pm
@@ -1153,18 +1153,32 @@ sub create {
# These don't work as normal constants.
DB_MODULE => \&Bugzilla::Constants::DB_MODULE,
- REQUIRED_MODULES =>
- \&Bugzilla::Install::Requirements::REQUIRED_MODULES,
+ REQUIRED_MODULES => sub {
+ my %required_modules;
+ my $cache = Bugzilla->request_cache;
+ my $meta = $cache->{cpan_meta} ||= Bugzilla::Install::Requirements::load_cpan_meta();
+ my $reqs = $meta->effective_prereqs->merged_requirements(['configure', 'runtime'], ['requires']);
+ foreach my $module (sort $reqs->required_modules) {
+ next if $module eq 'perl';
+ $required_modules{$module} = { version => $reqs->requirements_for_module($module) };
+ }
+ return \%required_modules;
+ },
OPTIONAL_MODULES => sub {
- my @optional = @{OPTIONAL_MODULES()};
- foreach my $item (@optional) {
- my @features;
- foreach my $feat_id (@{ $item->{feature} }) {
- push(@features, install_string("feature_$feat_id"));
+ my %optional_modules;
+ my $cache = Bugzilla->request_cache;
+ my $meta = $cache->{cpan_meta} ||= Bugzilla::Install::Requirements::load_cpan_meta();
+ foreach my $feature ($meta->features) {
+ my $reqs = $feature->prereqs->merged_requirements(['configure', 'runtime'], ['requires']);
+ foreach my $module ($reqs->required_modules) {
+ my $version = $reqs->requirements_for_module($module);
+ $optional_modules{$module} ||= {};
+ $optional_modules{$module}{version} = $version;
+ $optional_modules{$module}{features} ||= [];
+ push(@{$optional_modules{$module}{features}}, $feature->description);
}
- $item->{feature} = \@features;
}
- return \@optional;
+ return \%optional_modules;
},
'default_authorizer' => sub { return Bugzilla::Auth->new() },