Commit c0266d1f authored by bbaetz%acm.org's avatar bbaetz%acm.org

Bug 194394 - Internal error after turning useqacontact off

r,a=justdave
parent 9fc47ebe
...@@ -50,9 +50,13 @@ sub fields { ...@@ -50,9 +50,13 @@ sub fields {
bug_file_loc status_whiteboard keywords bug_file_loc status_whiteboard keywords
priority bug_severity target_milestone priority bug_severity target_milestone
dependson blocked votes dependson blocked votes
reporter assigned_to qa_contact cc reporter assigned_to cc
); );
if (Param('useqacontact')) {
push @fields, "qa_contact";
}
if (Param('timetrackinggroup')) { if (Param('timetrackinggroup')) {
push @fields, qw(estimated_time remaining_time actual_time); push @fields, qw(estimated_time remaining_time actual_time);
} }
...@@ -182,6 +186,8 @@ sub initBug { ...@@ -182,6 +186,8 @@ sub initBug {
if (Param('useqacontact') && $self->{'qa_contact'} > 0) { if (Param('useqacontact') && $self->{'qa_contact'} > 0) {
$self->{'qa_contact'} = new Bugzilla::User($self->{'qa_contact'}); $self->{'qa_contact'} = new Bugzilla::User($self->{'qa_contact'});
} else {
$self->{'qa_contact'} = undef;
} }
my $ccSet = new RelationSet; my $ccSet = new RelationSet;
...@@ -376,7 +382,7 @@ sub user { ...@@ -376,7 +382,7 @@ sub user {
# and actually try to make the change. # and actually try to make the change.
$self->{'user'}->{'canedit'} = $::userid == 0 $self->{'user'}->{'canedit'} = $::userid == 0
|| $::userid == $self->{'reporter'}{'id'} || $::userid == $self->{'reporter'}{'id'}
|| ($self->{'qa_contact'} && $::userid == $self->{'qa_contact'}{'id'}) || (Param('useqacontact') && $self->{'qa_contact'} && $::userid == $self->{'qa_contact'}{'id'})
|| $::userid == $self->{'assigned_to'}{'id'} || $::userid == $self->{'assigned_to'}{'id'}
|| &::UserInGroup("editbugs"); || &::UserInGroup("editbugs");
$self->{'user'}->{'canconfirm'} = $::userid == 0 $self->{'user'}->{'canconfirm'} = $::userid == 0
......
...@@ -50,9 +50,13 @@ sub fields { ...@@ -50,9 +50,13 @@ sub fields {
bug_file_loc status_whiteboard keywords bug_file_loc status_whiteboard keywords
priority bug_severity target_milestone priority bug_severity target_milestone
dependson blocked votes dependson blocked votes
reporter assigned_to qa_contact cc reporter assigned_to cc
); );
if (Param('useqacontact')) {
push @fields, "qa_contact";
}
if (Param('timetrackinggroup')) { if (Param('timetrackinggroup')) {
push @fields, qw(estimated_time remaining_time actual_time); push @fields, qw(estimated_time remaining_time actual_time);
} }
...@@ -182,6 +186,8 @@ sub initBug { ...@@ -182,6 +186,8 @@ sub initBug {
if (Param('useqacontact') && $self->{'qa_contact'} > 0) { if (Param('useqacontact') && $self->{'qa_contact'} > 0) {
$self->{'qa_contact'} = new Bugzilla::User($self->{'qa_contact'}); $self->{'qa_contact'} = new Bugzilla::User($self->{'qa_contact'});
} else {
$self->{'qa_contact'} = undef;
} }
my $ccSet = new RelationSet; my $ccSet = new RelationSet;
...@@ -376,7 +382,7 @@ sub user { ...@@ -376,7 +382,7 @@ sub user {
# and actually try to make the change. # and actually try to make the change.
$self->{'user'}->{'canedit'} = $::userid == 0 $self->{'user'}->{'canedit'} = $::userid == 0
|| $::userid == $self->{'reporter'}{'id'} || $::userid == $self->{'reporter'}{'id'}
|| ($self->{'qa_contact'} && $::userid == $self->{'qa_contact'}{'id'}) || (Param('useqacontact') && $self->{'qa_contact'} && $::userid == $self->{'qa_contact'}{'id'})
|| $::userid == $self->{'assigned_to'}{'id'} || $::userid == $self->{'assigned_to'}{'id'}
|| &::UserInGroup("editbugs"); || &::UserInGroup("editbugs");
$self->{'user'}->{'canconfirm'} = $::userid == 0 $self->{'user'}->{'canconfirm'} = $::userid == 0
......
...@@ -661,7 +661,7 @@ sub CanSeeBug { ...@@ -661,7 +661,7 @@ sub CanSeeBug {
|| (($userid > 0) && || (($userid > 0) &&
( (
($assigned_to == $userid) ($assigned_to == $userid)
|| ($qa_contact == $userid) || (Param('useqacontact') && $qa_contact == $userid)
|| (($reporter == $userid) && $rep_access) || (($reporter == $userid) && $rep_access)
|| ($found_cc && $cc_access) || ($found_cc && $cc_access)
|| ($found_groups == $found_members) || ($found_groups == $found_members)
......
...@@ -410,7 +410,7 @@ sub CheckCanChangeField { ...@@ -410,7 +410,7 @@ sub CheckCanChangeField {
} }
# Allow the QA contact to change anything. # Allow the QA contact to change anything.
if ($qacontactid eq $whoid) { if (Param('useqacontact') && ($qacontactid eq $whoid)) {
return 1; return 1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment