From: bbaetz%acm.org <> Date: Sun, 23 Feb 2003 15:31:07 +0000 (+0000) Subject: Bug 194394 - Internal error after turning useqacontact off X-Git-Tag: bugzilla-2.17.4~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0266d1fcdc15f5ccfb5890492a42f4ea598437b;p=thirdparty%2Fbugzilla.git Bug 194394 - Internal error after turning useqacontact off r,a=justdave --- diff --git a/Bug.pm b/Bug.pm index 14876dbe3a..b451190e2a 100755 --- a/Bug.pm +++ b/Bug.pm @@ -50,9 +50,13 @@ sub fields { bug_file_loc status_whiteboard keywords priority bug_severity target_milestone dependson blocked votes - reporter assigned_to qa_contact cc + reporter assigned_to cc ); + if (Param('useqacontact')) { + push @fields, "qa_contact"; + } + if (Param('timetrackinggroup')) { push @fields, qw(estimated_time remaining_time actual_time); } @@ -182,6 +186,8 @@ sub initBug { if (Param('useqacontact') && $self->{'qa_contact'} > 0) { $self->{'qa_contact'} = new Bugzilla::User($self->{'qa_contact'}); + } else { + $self->{'qa_contact'} = undef; } my $ccSet = new RelationSet; @@ -376,7 +382,7 @@ sub user { # and actually try to make the change. $self->{'user'}->{'canedit'} = $::userid == 0 || $::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'} || &::UserInGroup("editbugs"); $self->{'user'}->{'canconfirm'} = $::userid == 0 diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 14876dbe3a..b451190e2a 100755 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -50,9 +50,13 @@ sub fields { bug_file_loc status_whiteboard keywords priority bug_severity target_milestone dependson blocked votes - reporter assigned_to qa_contact cc + reporter assigned_to cc ); + if (Param('useqacontact')) { + push @fields, "qa_contact"; + } + if (Param('timetrackinggroup')) { push @fields, qw(estimated_time remaining_time actual_time); } @@ -182,6 +186,8 @@ sub initBug { if (Param('useqacontact') && $self->{'qa_contact'} > 0) { $self->{'qa_contact'} = new Bugzilla::User($self->{'qa_contact'}); + } else { + $self->{'qa_contact'} = undef; } my $ccSet = new RelationSet; @@ -376,7 +382,7 @@ sub user { # and actually try to make the change. $self->{'user'}->{'canedit'} = $::userid == 0 || $::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'} || &::UserInGroup("editbugs"); $self->{'user'}->{'canconfirm'} = $::userid == 0 diff --git a/globals.pl b/globals.pl index 62fc1d6335..812fdff150 100644 --- a/globals.pl +++ b/globals.pl @@ -661,7 +661,7 @@ sub CanSeeBug { || (($userid > 0) && ( ($assigned_to == $userid) - || ($qa_contact == $userid) + || (Param('useqacontact') && $qa_contact == $userid) || (($reporter == $userid) && $rep_access) || ($found_cc && $cc_access) || ($found_groups == $found_members) diff --git a/process_bug.cgi b/process_bug.cgi index 6f0d641750..94c74fcf5f 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -410,7 +410,7 @@ sub CheckCanChangeField { } # Allow the QA contact to change anything. - if ($qacontactid eq $whoid) { + if (Param('useqacontact') && ($qacontactid eq $whoid)) { return 1; }