summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorVladimir Panteleev <github.private@thecybershadow.net>2018-04-08 05:57:06 +0200
committerDylan William Hardison <dylan@hardison.net>2018-04-08 05:57:06 +0200
commitb0935c1e52eea1dfc70652bf6fcb7c8b856a8826 (patch)
tree2400c507178262779288c10ccdfc773d858da098 /Bugzilla
parent2d80cea9010f694524f5d165a19697c47535d779 (diff)
downloadbugzilla-b0935c1e52eea1dfc70652bf6fcb7c8b856a8826.tar.gz
bugzilla-b0935c1e52eea1dfc70652bf6fcb7c8b856a8826.tar.xz
Bug 1446236 - Add & use simpler method to check if an extension is present (#35)
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Search.pm6
1 files changed, 2 insertions, 4 deletions
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm
index 643d591ca..e15c60f7f 100644
--- a/Bugzilla/Search.pm
+++ b/Bugzilla/Search.pm
@@ -34,7 +34,6 @@ use Date::Format;
use Date::Parse;
use Scalar::Util qw(blessed);
use List::MoreUtils qw(all firstidx part uniq);
-use List::Util qw(any);
use POSIX qw(INT_MAX);
use Storable qw(dclone);
use Time::HiRes qw(gettimeofday tv_interval);
@@ -803,8 +802,7 @@ sub data {
# BMO - to avoid massive amounts of joins, if we're selecting a lot of
# tracking flags, replace them with placeholders. the values will be
# retrieved later and injected into the result.
- state $have_tracking_flags = any { $_->NAME eq 'TrackingFlags' } @{ Bugzilla->extensions };
- if ($have_tracking_flags) {
+ if (Bugzilla->has_extension('TrackingFlags')) {
my %tf_map = map { $_ => 1 } Bugzilla::Extension::TrackingFlags::Flag->get_all_names();
my @tf_selected = grep { exists $tf_map{$_} } @orig_fields;
# mysql has a limit of 61 joins, and we want to avoid massive amounts of joins
@@ -867,7 +865,7 @@ sub data {
$self->{data} = [map { $data{$_} } @$bug_ids];
# BMO - get tracking flags values, and insert into result
- if ($have_tracking_flags && @{ $self->{tracking_flags} }) {
+ if (Bugzilla->has_extension('TrackingFlags') && @{ $self->{tracking_flags} }) {
# read values
my $values;
$sql = "