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
72c4efb6
Commit
72c4efb6
authored
Feb 17, 2010
by
Frédéric Buclin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 494403: "Default" groups don't get set on bug creation using email_in.pl
r/a=mkanat
parent
d10c13e0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
1 deletion
+22
-1
email_in.pl
email_in.pl
+22
-1
No files found.
email_in.pl
View file @
72c4efb6
...
...
@@ -47,7 +47,7 @@ use Bugzilla;
use
Bugzilla::
Attachment
;
use
Bugzilla::
Bug
;
use
Bugzilla::
BugMail
;
use
Bugzilla::
Constants
qw(USAGE_MODE_EMAIL CMT_ATTACHMENT_CREATED)
;
use
Bugzilla::
Constants
;
use
Bugzilla::
Error
;
use
Bugzilla::
Mailer
;
use
Bugzilla::
Token
;
...
...
@@ -145,6 +145,8 @@ sub post_bug {
my
(
$fields
)
=
@_
;
debug_print
(
'Posting a new bug...'
);
my
$user
=
Bugzilla
->
user
;
# Bugzilla::Bug->create throws a confusing CodeError if
# the REQUIRED_CREATE_FIELDS are missing, but much more
# sensible errors if the fields exist but are just undef.
...
...
@@ -152,6 +154,25 @@ sub post_bug {
$fields
->
{
$field
}
=
undef
if
!
exists
$fields
->
{
$field
};
}
# Restrict the bug to groups marked as Default.
# We let Bug->create throw an error if the product is
# not accessible, to throw the correct message.
my
$product
=
new
Bugzilla::
Product
({
name
=>
$fields
->
{
product
}
});
if
(
$product
)
{
my
@gids
;
my
$controls
=
$product
->
group_controls
;
foreach
my
$gid
(
keys
%
$controls
)
{
if
((
$controls
->
{
$gid
}
->
{
membercontrol
}
==
CONTROLMAPDEFAULT
&&
$user
->
in_group_id
(
$gid
))
||
(
$controls
->
{
$gid
}
->
{
othercontrol
}
==
CONTROLMAPDEFAULT
&&
!
$user
->
in_group_id
(
$gid
)))
{
push
(
@gids
,
$gid
);
}
}
$fields
->
{
groups
}
=
\
@gids
;
}
my
(
$retval
,
$non_conclusive_fields
)
=
Bugzilla::User::
match_field
({
'assigned_to'
=>
{
'type'
=>
'single'
},
...
...
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