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
7df590fa
Commit
7df590fa
authored
May 24, 2010
by
Max Kanat-Alexander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 556901: Move the code for setting status, resolution, and dup_id
from process_bug.cgi into Bugzilla::Bug::set_all
parent
dd80a671
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
29 deletions
+32
-29
Bug.pm
Bugzilla/Bug.pm
+29
-0
process_bug.cgi
process_bug.cgi
+3
-29
No files found.
Bugzilla/Bug.pm
View file @
7df590fa
...
...
@@ -1886,6 +1886,8 @@ sub _set_global_validator {
# "Set" Methods #
#################
# Note that if you are changing multiple bugs at once, you must pass
# other_bugs to set_all in order for it to behave properly.
sub
set_all
{
my
$self
=
shift
;
my
(
$params
)
=
@_
;
...
...
@@ -1946,6 +1948,8 @@ sub set_all {
my
%
normal_set_all
;
foreach
my
$name
(
keys
%
$params
)
{
# These are handled separately below.
next
if
grep
(
$_
eq
$name
,
qw(status resolution dup_id)
);
if
(
$self
->
can
(
"set_$name"
))
{
$normal_set_all
{
$name
}
=
$params
->
{
$name
};
}
...
...
@@ -1975,6 +1979,31 @@ sub set_all {
# do that here, because if they *did* change the assignee, qa, or CC,
# then we don't want to check the original ones, only the new ones.
$self
->
_check_strict_isolation
()
if
$product_changed
;
# You cannot mark bugs as duplicates when changing several bugs at once
# (because currently there is no way to check for duplicate loops in that
# situation).
if
(
exists
$params
->
{
'dup_id'
}
and
$params
->
{
other_bugs
}
and
scalar
@
{
$params
->
{
other_bugs
}
}
>
1
)
{
ThrowUserError
(
'dupe_not_allowed'
);
}
# Seting the status, resolution, and dupe_of has to be done
# down here, because the validity of status changes depends on
# other fields, such as Target Milestone.
if
(
exists
$params
->
{
'status'
})
{
$self
->
set_status
(
$params
->
{
'status'
},
{
resolution
=>
$params
->
{
'resolution'
},
dupe_of
=>
$params
->
{
'dup_id'
}
});
}
elsif
(
exists
$params
->
{
'resolution'
})
{
$self
->
set_resolution
(
$params
->
{
'resolution'
},
{
dupe_of
=>
$params
->
{
'dup_id'
}
});
}
elsif
(
exists
$params
->
{
'dup_id'
})
{
$self
->
set_dup_id
(
$params
->
{
'dup_id'
});
}
}
# Helper for set_all that helps with fields that have an "add/remove"
...
...
process_bug.cgi
View file @
7df590fa
...
...
@@ -249,7 +249,8 @@ my @set_fields = qw(op_sys rep_platform priority bug_severity
work_time set_default_assignee set_default_qa_contact
keywords keywordaction
cclist_accessible reporter_accessible
product confirm_product_change)
;
product confirm_product_change
bug_status resolution dup_id)
;
push
(
@set_fields
,
'assigned_to'
)
if
!
$cgi
->
param
(
'set_default_assignee'
);
push
(
@set_fields
,
'qa_contact'
)
if
!
$cgi
->
param
(
'set_default_qa_contact'
);
my
%
field_translation
=
(
...
...
@@ -261,6 +262,7 @@ my %field_translation = (
set_default_qa_contact
=>
'reset_qa_contact'
,
keywordaction
=>
'keywords_action'
,
confirm_product_change
=>
'product_change_confirmed'
,
bug_status
=>
'status'
,
);
my
%
set_all_fields
=
(
other_bugs
=>
\
@bug_objects
);
...
...
@@ -454,34 +456,6 @@ if ($move_action eq Bugzilla->params->{'move-button-text'}) {
exit
;
}
# You cannot mark bugs as duplicates when changing several bugs at once
# (because currently there is no way to check for duplicate loops in that
# situation).
if
(
!
$cgi
->
param
(
'id'
)
&&
$cgi
->
param
(
'dup_id'
))
{
ThrowUserError
(
'dupe_not_allowed'
);
}
# Set the status, resolution, and dupe_of (if needed). This has to be done
# down here, because the validity of status changes depends on other fields,
# such as Target Milestone.
foreach
my
$b
(
@bug_objects
)
{
if
(
should_set
(
'bug_status'
))
{
$b
->
set_status
(
scalar
$cgi
->
param
(
'bug_status'
),
{
resolution
=>
scalar
$cgi
->
param
(
'resolution'
),
dupe_of
=>
scalar
$cgi
->
param
(
'dup_id'
)}
);
}
elsif
(
should_set
(
'resolution'
))
{
$b
->
set_resolution
(
scalar
$cgi
->
param
(
'resolution'
),
{
dupe_of
=>
scalar
$cgi
->
param
(
'dup_id'
)});
}
elsif
(
should_set
(
'dup_id'
))
{
$b
->
set_dup_id
(
scalar
$cgi
->
param
(
'dup_id'
));
}
}
##############################
# Do Actual Database Updates #
##############################
...
...
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