Commit 4cbac025 authored by Frédéric Buclin's avatar Frédéric Buclin

Bug 1153027: Bugzilla->feature incorrectly checks Perl modules

r=dkl a=glob
parent d725139a
...@@ -31,7 +31,7 @@ use Bugzilla::Extension; ...@@ -31,7 +31,7 @@ use Bugzilla::Extension;
use Bugzilla::Field; use Bugzilla::Field;
use Bugzilla::Flag; use Bugzilla::Flag;
use Bugzilla::Install::Localconfig qw(read_localconfig); use Bugzilla::Install::Localconfig qw(read_localconfig);
use Bugzilla::Install::Requirements qw(OPTIONAL_MODULES); use Bugzilla::Install::Requirements qw(OPTIONAL_MODULES have_vers);
use Bugzilla::Install::Util qw(init_console include_languages); use Bugzilla::Install::Util qw(init_console include_languages);
use Bugzilla::Memcached; use Bugzilla::Memcached;
use Bugzilla::Template; use Bugzilla::Template;
...@@ -220,7 +220,7 @@ sub feature { ...@@ -220,7 +220,7 @@ sub feature {
foreach my $package (@{ OPTIONAL_MODULES() }) { foreach my $package (@{ OPTIONAL_MODULES() }) {
foreach my $f (@{ $package->{feature} }) { foreach my $f (@{ $package->{feature} }) {
$feature_map->{$f} ||= []; $feature_map->{$f} ||= [];
push(@{ $feature_map->{$f} }, $package->{module}); push(@{ $feature_map->{$f} }, $package);
} }
} }
$cache->{feature_map} = $feature_map; $cache->{feature_map} = $feature_map;
...@@ -231,8 +231,8 @@ sub feature { ...@@ -231,8 +231,8 @@ sub feature {
} }
my $success = 1; my $success = 1;
foreach my $module (@{ $feature_map->{$feature} }) { foreach my $package (@{ $feature_map->{$feature} }) {
eval "require $module" or $success = 0; have_vers($package) or $success = 0;
} }
$cache->{feature}->{$feature} = $success; $cache->{feature}->{$feature} = $success;
return $success; return $success;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment