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
acdcae1b
Commit
acdcae1b
authored
May 17, 2010
by
Max Kanat-Alexander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 556373: Move the adding/removing of groups from process_bug.cgi to
Bugzilla::Bug::set_all r=dkl, a=mkanat
parent
e49e5f21
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
26 deletions
+38
-26
Bug.pm
Bugzilla/Bug.pm
+11
-1
process_bug.cgi
process_bug.cgi
+27
-25
No files found.
Bugzilla/Bug.pm
View file @
acdcae1b
...
...
@@ -1854,6 +1854,15 @@ sub set_all {
my
$self
=
shift
;
my
(
$params
)
=
@_
;
# strict_isolation checks mean that we should set the groups
# immediately after changing the product.
foreach
my
$group
(
@
{
$params
->
{
groups
}
->
{
add
}
||
[]
})
{
$self
->
add_group
(
$group
);
}
foreach
my
$group
(
@
{
$params
->
{
groups
}
->
{
remove
}
||
[]
})
{
$self
->
remove_group
(
$group
);
}
if
(
exists
$params
->
{
'dependson'
}
or
exists
$params
->
{
'blocked'
})
{
my
%
set_deps
;
foreach
my
$name
(
qw(dependson blocked)
)
{
...
...
@@ -2400,7 +2409,8 @@ sub add_group {
# to this group by the current user.
$self
->
product_obj
->
group_is_settable
(
$group
)
||
ThrowUserError
(
'group_invalid_restriction'
,
{
product
=>
$self
->
product
,
group_id
=>
$group
->
id
});
{
product
=>
$self
->
product
,
group_id
=>
$group
->
id
,
bug
=>
$self
});
# OtherControl people can add groups only during a product change,
# and only when the group is not NA for them.
...
...
process_bug.cgi
View file @
acdcae1b
...
...
@@ -255,31 +255,6 @@ if (should_set('product')) {
}
}
# strict_isolation checks mean that we should set the groups
# immediately after changing the product.
foreach
my
$b
(
@bug_objects
)
{
foreach
my
$group
(
@
{
$b
->
product_obj
->
groups_valid
})
{
my
$gid
=
$group
->
id
;
if
(
should_set
(
"bit-$gid"
,
1
))
{
# Check ! first to avoid having to check defined below.
if
(
!
$cgi
->
param
(
"bit-$gid"
))
{
$b
->
remove_group
(
$gid
);
}
# "== 1" is important because mass-change uses -1 to mean
# "don't change this restriction"
elsif
(
$cgi
->
param
(
"bit-$gid"
)
==
1
)
{
$b
->
add_group
(
$gid
);
}
}
}
}
# Flags should be set AFTER the bug has been moved into another product/component.
if
(
$cgi
->
param
(
'id'
))
{
my
(
$flags
,
$new_flags
)
=
Bugzilla::
Flag
->
extract_flags_from_cgi
(
$first_bug
,
undef
,
$vars
);
$first_bug
->
set_flags
(
$flags
,
$new_flags
);
}
# Component, target_milestone, and version are in here just in case
# the 'product' field wasn't defined in the CGI. It doesn't hurt to set
# them twice.
...
...
@@ -333,6 +308,27 @@ foreach my $dep_field (qw(dependson blocked)) {
}
}
}
my
%
groups
=
(
add
=>
[]
,
remove
=>
[]
);
my
%
checked_bit
;
# Used to avoid adding groups twice (defined_ + actual bit-)
foreach
my
$param_name
(
grep
(
/bit-\d+$/
,
$cgi
->
param
()))
{
$param_name
=~
/bit-(\d+)$/
;
my
$gid
=
$1
;
next
if
$checked_bit
{
$gid
};
my
$bit_param
=
"bit-$gid"
;
if
(
should_set
(
$bit_param
,
1
))
{
# Check ! first to avoid having to check defined below.
if
(
!
$cgi
->
param
(
$bit_param
))
{
push
(
@
{
$groups
{
remove
}
},
$gid
);
}
# "== 1" is important because mass-change uses -1 to mean
# "don't change this restriction"
elsif
(
$cgi
->
param
(
$bit_param
)
==
1
)
{
push
(
@
{
$groups
{
add
}
},
$gid
);
}
}
$checked_bit
{
$gid
}
=
1
;
}
$set_all_fields
{
groups
}
=
\%
groups
;
my
@custom_fields
=
Bugzilla
->
active_custom_fields
;
foreach
my
$field
(
@custom_fields
)
{
...
...
@@ -348,6 +344,12 @@ foreach my $b (@bug_objects) {
# Certain changes can only happen on individual bugs, never on mass-changes.
if
(
defined
$cgi
->
param
(
'id'
))
{
# Flags should be set AFTER the bug has been moved into another
# product/component.
my
(
$flags
,
$new_flags
)
=
Bugzilla::
Flag
->
extract_flags_from_cgi
(
$first_bug
,
undef
,
$vars
);
$first_bug
->
set_flags
(
$flags
,
$new_flags
);
# Since aliases are unique (like bug numbers), they can only be changed
# for one bug at a time.
if
(
Bugzilla
->
params
->
{
"usebugaliases"
}
&&
defined
$cgi
->
param
(
'alias'
))
{
...
...
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