aboutsummaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2008-01-21 04:12:50 +0000
committerlpsolit%gmail.com <>2008-01-21 04:12:50 +0000
commitba84ffa3c85f05ca48b678902eeb5b72951cf0c2 (patch)
tree41e0556460b1d3f659acde46121a45cdd570e642 /Bugzilla
parente07db2a55af817d820c12e61f73023e86c7c0a38 (diff)
downloadbugs-ba84ffa3c85f05ca48b678902eeb5b72951cf0c2.tar
bugs-ba84ffa3c85f05ca48b678902eeb5b72951cf0c2.tar.gz
bugs-ba84ffa3c85f05ca48b678902eeb5b72951cf0c2.tar.bz2
bugs-ba84ffa3c85f05ca48b678902eeb5b72951cf0c2.tar.xz
bugs-ba84ffa3c85f05ca48b678902eeb5b72951cf0c2.zip
Bug 413258: When setting a flag on an attachment on bug creation, an incorrect message is displayed - Patch by Frédéric Buclin <LpSolit@gmail.com> a=LpSolit
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Flag.pm9
1 files changed, 6 insertions, 3 deletions
diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm
index adc92cfd4..9dc6a2ef5 100644
--- a/Bugzilla/Flag.pm
+++ b/Bugzilla/Flag.pm
@@ -963,10 +963,9 @@ sub FormToNewFlags {
return () unless scalar(@type_ids);
- # Get a list of active flag types available for this target.
+ # Get a list of active flag types available for this product/component.
my $flag_types = Bugzilla::FlagType::match(
- { 'target_type' => $attachment ? 'attachment' : 'bug',
- 'product_id' => $bug->{'product_id'},
+ { 'product_id' => $bug->{'product_id'},
'component_id' => $bug->{'component_id'},
'is_active' => 1 });
@@ -982,6 +981,10 @@ sub FormToNewFlags {
foreach my $flag_type (@$flag_types) {
my $type_id = $flag_type->id;
+ # Bug flags are only valid for bugs, and attachment flags are
+ # only valid for attachments. So don't mix both.
+ next unless ($flag_type->target_type eq 'bug' xor $attachment);
+
# We are only interested in flags the user tries to create.
next unless scalar(grep { $_ == $type_id } @type_ids);