Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
bb61c992
Commit
bb61c992
authored
Sep 10, 2006
by
mkanat%bugzilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 351339: Move group insertion out of post_bug.cgi and into Bugzilla::Bug
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=justdave
parent
1a4d88f3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
10 deletions
+15
-10
Bug.pm
Bugzilla/Bug.pm
+14
-1
post_bug.cgi
post_bug.cgi
+1
-9
No files found.
Bugzilla/Bug.pm
View file @
bb61c992
...
...
@@ -242,13 +242,23 @@ sub create {
$class
->
check_required_create_fields
(
@_
);
my
$params
=
$class
->
run_create_validators
(
@_
);
#
"cc" is not a field in the bugs table, so we don't pass it
to
#
These are not a fields in the bugs table, so we don't pass them
to
# insert_create_data.
my
$cc_ids
=
$params
->
{
cc
};
delete
$params
->
{
cc
};
my
$groups
=
$params
->
{
groups
};
delete
$params
->
{
groups
};
my
$bug
=
$class
->
insert_create_data
(
$params
);
# Add the group restrictions
my
$sth_group
=
$dbh
->
prepare
(
'INSERT INTO bug_group_map (bug_id, group_id) VALUES (?, ?)'
);
foreach
my
$group_id
(
@$groups
)
{
$sth_group
->
execute
(
$bug
->
bug_id
,
$group_id
);
}
# Add the CCs
my
$sth_cc
=
$dbh
->
prepare
(
'INSERT INTO cc (bug_id, who) VALUES (?,?)'
);
foreach
my
$user_id
(
@$cc_ids
)
{
$sth_cc
->
execute
(
$bug
->
bug_id
,
$user_id
);
...
...
@@ -274,6 +284,9 @@ sub run_create_validators {
$params
->
{
version
}
=
$class
->
_check_version
(
$product
,
$params
->
{
version
});
$params
->
{
groups
}
=
$class
->
_check_groups
(
$product
,
$params
->
{
groups
});
my
$component
=
$class
->
_check_component
(
$product
,
$params
->
{
component
});
$params
->
{
component_id
}
=
$component
->
id
;
delete
$params
->
{
component
};
...
...
post_bug.cgi
View file @
bb61c992
...
...
@@ -145,8 +145,6 @@ foreach my $group (grep(/^bit-\d+$/, $cgi->param())) {
push
(
@selected_groups
,
$1
);
}
my
@add_groups
=
@
{
Bugzilla::
Bug
->
_check_groups
(
$product
,
\
@selected_groups
)};
# Include custom fields editable on bug creation.
my
@custom_bug_fields
=
Bugzilla
->
get_fields
(
{
custom
=>
1
,
obsolete
=>
0
,
enter_bug
=>
1
});
...
...
@@ -185,6 +183,7 @@ foreach my $field (@bug_fields) {
}
$bug_params
{
'creation_ts'
}
=
$timestamp
;
$bug_params
{
'cc'
}
=
[
$cgi
->
param
(
'cc'
)];
$bug_params
{
'groups'
}
=
\
@selected_groups
;
# Add the bug report to the DB.
$dbh
->
bz_lock_tables
(
'bugs WRITE'
,
'bug_group_map WRITE'
,
'longdescs WRITE'
,
...
...
@@ -202,13 +201,6 @@ my $bug = Bugzilla::Bug->create(\%bug_params);
# Get the bug ID back.
my
$id
=
$bug
->
bug_id
;
# Add the group restrictions
my
$sth_addgroup
=
$dbh
->
prepare
(
q{
INSERT INTO bug_group_map (bug_id, group_id) VALUES (?, ?)}
);
foreach
my
$group_id
(
@add_groups
)
{
$sth_addgroup
->
execute
(
$id
,
$group_id
);
}
# Add the initial comment, allowing for the fact that it may be private
my
$privacy
=
0
;
if
(
Bugzilla
->
params
->
{
"insidergroup"
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment