summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2013-08-20 05:35:37 +0200
committerByron Jones <bjones@mozilla.com>2013-08-20 05:35:37 +0200
commit0d90d9eca71347143bafbefaf8cd6d0270576e63 (patch)
tree3b1c80aa301f0bd46511ca60bbfb88e3e2aa6744 /extensions
parentb4b2dd7998f7d4e5a47c942d11f802c0524b457f (diff)
downloadbugzilla-0d90d9eca71347143bafbefaf8cd6d0270576e63.tar.gz
bugzilla-0d90d9eca71347143bafbefaf8cd6d0270576e63.tar.xz
Bug 906597: loading a bug with an inactive-but-set tracking flag throws: Can't call method 'sortkey' on an undefined value
Diffstat (limited to 'extensions')
-rw-r--r--extensions/TrackingFlags/lib/Flag.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/extensions/TrackingFlags/lib/Flag.pm b/extensions/TrackingFlags/lib/Flag.pm
index 54b2afcf7..f35b661eb 100644
--- a/extensions/TrackingFlags/lib/Flag.pm
+++ b/extensions/TrackingFlags/lib/Flag.pm
@@ -186,10 +186,15 @@ sub match {
$params->{'id'} = \@flag_ids;
}
- my $flags = $class->SUPER::match(@_);
+ # We need to return inactive flags if a value has been set
+ my $is_active_filter = delete $params->{is_active};
+ my $flags = $class->SUPER::match($params);
preload_all_the_things($flags, { bug_id => $bug_id });
+ if ($is_active_filter) {
+ $flags = [ grep { $_->is_active || exists $_->{bug_flag} } @$flags ];
+ }
return [ sort { $a->sortkey <=> $b->sortkey } @$flags ];
}