summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/DB/Schema.pm4
-rw-r--r--Bugzilla/Product.pm11
-rw-r--r--Bugzilla/WebService/Constants.pm1
3 files changed, 14 insertions, 2 deletions
diff --git a/Bugzilla/DB/Schema.pm b/Bugzilla/DB/Schema.pm
index 41afaeacf..561aa3a4f 100644
--- a/Bugzilla/DB/Schema.pm
+++ b/Bugzilla/DB/Schema.pm
@@ -1419,9 +1419,9 @@ use constant ABSTRACT_SCHEMA => {
COLUMN => 'id',
DELETE => 'SET NULL'}},
security_group_id => {TYPE => 'INT3',
+ NOTNULL => 1,
REFERENCES => {TABLE => 'groups',
- COLUMN => 'id',
- DELETE => 'SET NULL'}},
+ COLUMN => 'id'}},
],
INDEXES => [
products_name_idx => {FIELDS => ['name'],
diff --git a/Bugzilla/Product.pm b/Bugzilla/Product.pm
index 9cf4bf397..3fc4db77f 100644
--- a/Bugzilla/Product.pm
+++ b/Bugzilla/Product.pm
@@ -70,6 +70,7 @@ use constant VALIDATORS => {
description => \&_check_description,
version => \&_check_version,
defaultmilestone => \&_check_default_milestone,
+ security_group_id => \&_check_security_group_id,
isactive => \&Bugzilla::Object::check_boolean,
create_series => \&Bugzilla::Object::check_boolean
};
@@ -395,6 +396,16 @@ sub _check_version {
return $version;
}
+sub _check_security_group_id {
+ my ($invocant, $id) = @_;
+
+ $id = trim($id);
+
+ ThrowUserError('product_must_have_security_group') unless $id;
+
+ return $id;
+}
+
sub _check_default_milestone {
my ($invocant, $milestone) = @_;
diff --git a/Bugzilla/WebService/Constants.pm b/Bugzilla/WebService/Constants.pm
index 93fddfc2b..e43918a43 100644
--- a/Bugzilla/WebService/Constants.pm
+++ b/Bugzilla/WebService/Constants.pm
@@ -184,6 +184,7 @@ use constant WS_ERROR_CODE => {
product_must_have_description => 703,
product_must_have_version => 704,
product_must_define_defaultmilestone => 705,
+ product_must_have_security_group => 706,
# Group errors are 800-900
empty_group_name => 800,