summaryrefslogtreecommitdiffstats
path: root/post_bug.cgi
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2006-08-23 07:52:10 +0200
committermkanat%bugzilla.org <>2006-08-23 07:52:10 +0200
commit6d154983302359ba9d38e1ff659c580853f68c2d (patch)
treef2a67837b1a4d5accaa62d7e294cbeb09ed1ad96 /post_bug.cgi
parent363f5a4e621378b1343c4621a765cb9aa9025cb9 (diff)
downloadbugzilla-6d154983302359ba9d38e1ff659c580853f68c2d.tar.gz
bugzilla-6d154983302359ba9d38e1ff659c580853f68c2d.tar.xz
Bug 349555: Move dependency validation from post_bug into Bugzilla::Bug
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=bkor, a=justdave
Diffstat (limited to 'post_bug.cgi')
-rwxr-xr-xpost_bug.cgi23
1 files changed, 3 insertions, 20 deletions
diff --git a/post_bug.cgi b/post_bug.cgi
index dab0ba507..f90585020 100755
--- a/post_bug.cgi
+++ b/post_bug.cgi
@@ -227,26 +227,8 @@ my @keyword_ids = @{Bugzilla::Bug::_check_keywords($cgi->param('keywords'))};
Bugzilla::Bug::_check_strict_isolation($product, $cc_ids,
$cgi->param('assigned_to'), $cgi->param('qa_contact'));
-# Check for valid dependency info.
-foreach my $field ("dependson", "blocked") {
- if (UserInGroup("editbugs") && $cgi->param($field)) {
- my @validvalues;
- foreach my $id (split(/[\s,]+/, $cgi->param($field))) {
- next unless $id;
- # $field is not passed to ValidateBugID to prevent adding new
- # dependencies on inaccessible bugs.
- ValidateBugID($id);
- push(@validvalues, $id);
- }
- $cgi->param(-name => $field, -value => join(",", @validvalues));
- }
-}
-# Gather the dependency list, and make sure there are no circular refs
-my %deps;
-if (UserInGroup("editbugs")) {
- %deps = Bugzilla::Bug::ValidateDependencies(scalar($cgi->param('dependson')),
- scalar($cgi->param('blocked')));
-}
+my ($depends_on_ids, $blocks_ids) = Bugzilla::Bug::_check_dependencies(
+ scalar $cgi->param('dependson'), scalar $cgi->param('blocked'));
# get current time
my $timestamp = $dbh->selectrow_array(q{SELECT NOW()});
@@ -415,6 +397,7 @@ if (UserInGroup("editbugs")) {
WHERE bug_id = ?}, undef, ($timestamp, $kw_list, $id));
}
if ($cgi->param('dependson') || $cgi->param('blocked')) {
+ my %deps = (dependson => $depends_on_ids, blocked => $blocks_ids);
foreach my $pair (["blocked", "dependson"], ["dependson", "blocked"]) {
my ($me, $target) = @{$pair};
my $sth_dep = $dbh->prepare(qq{