summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Bug.pm
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2013-04-19 00:55:59 +0200
committerDave Lawrence <dlawrence@mozilla.com>2013-04-19 00:55:59 +0200
commitc69cbc8008696c82747b833bca5cfa2faf9c1594 (patch)
tree6611bbb98833e2081af78a454465424c1b035e05 /Bugzilla/Bug.pm
parent01848b6f328992497d8b25b3057893c086de7751 (diff)
parent2aecaaf29af1866367a362bbd57c6b5258d6440e (diff)
downloadbugzilla-c69cbc8008696c82747b833bca5cfa2faf9c1594.tar.gz
bugzilla-c69cbc8008696c82747b833bca5cfa2faf9c1594.tar.xz
merged with bugzilla/4.2
Diffstat (limited to 'Bugzilla/Bug.pm')
-rw-r--r--Bugzilla/Bug.pm20
1 files changed, 12 insertions, 8 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index a873d63be..08c347abe 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -745,6 +745,17 @@ sub run_create_validators {
my $class = shift;
my $params = $class->SUPER::run_create_validators(@_);
+ # Add classification for checking mandatory fields which depend on it
+ $params->{classification} = $params->{product}->classification->name;
+
+ my @mandatory_fields = @{ Bugzilla->fields({ is_mandatory => 1,
+ enter_bug => 1,
+ obsolete => 0 }) };
+ foreach my $field (@mandatory_fields) {
+ $class->_check_field_is_mandatory($params->{$field->name}, $field,
+ $params);
+ }
+
my $product = delete $params->{product};
$params->{product_id} = $product->id;
my $component = delete $params->{component};
@@ -769,18 +780,11 @@ sub run_create_validators {
delete $params->{resolution};
delete $params->{lastdiffed};
delete $params->{bug_id};
+ delete $params->{classification};
Bugzilla::Hook::process('bug_end_of_create_validators',
{ params => $params });
- my @mandatory_fields = @{ Bugzilla->fields({ is_mandatory => 1,
- enter_bug => 1,
- obsolete => 0 }) };
- foreach my $field (@mandatory_fields) {
- $class->_check_field_is_mandatory($params->{$field->name}, $field,
- $params);
- }
-
return $params;
}