summaryrefslogtreecommitdiffstats
path: root/process_bug.cgi
diff options
context:
space:
mode:
authormkanat%kerio.com <>2005-03-15 14:20:47 +0100
committermkanat%kerio.com <>2005-03-15 14:20:47 +0100
commit0ce44681395c0a6ef5d8a54caa8aca73728b3b25 (patch)
treee804038f1f134bf7d91da9125e45de3703c59ed0 /process_bug.cgi
parent0ab2e4bfd6429efa18c46ad76db69ecfa470e750 (diff)
downloadbugzilla-0ce44681395c0a6ef5d8a54caa8aca73728b3b25.tar.gz
bugzilla-0ce44681395c0a6ef5d8a54caa8aca73728b3b25.tar.xz
Bug 285534: bugs.qa_contact should allow NULL
Patch By Max Kanat-Alexander <mkanat@kerio.com> r=joel, a=justdave
Diffstat (limited to 'process_bug.cgi')
-rwxr-xr-xprocess_bug.cgi22
1 files changed, 17 insertions, 5 deletions
diff --git a/process_bug.cgi b/process_bug.cgi
index 0b9354171..219e9226d 100755
--- a/process_bug.cgi
+++ b/process_bug.cgi
@@ -349,6 +349,9 @@ sub CheckCanChangeField {
# START DO_NOT_CHANGE
my ($field, $bugid, $oldvalue, $newvalue) = (@_);
+ $oldvalue = defined($oldvalue) ? $oldvalue : '';
+ $newvalue = defined($newvalue) ? $newvalue : '';
+
# Return true if they haven't changed this field at all.
if ($oldvalue eq $newvalue) {
return 1;
@@ -436,7 +439,7 @@ sub CheckCanChangeField {
}
# Allow the QA contact to change anything else.
- if (Param('useqacontact') && ($qacontactid == $whoid)) {
+ if (Param('useqacontact') && $qacontactid && ($qacontactid == $whoid)) {
return 1;
}
@@ -877,13 +880,17 @@ my $qacontact;
if (defined $::FORM{'qa_contact'}
&& $::FORM{'knob'} ne "reassignbycomponent")
{
- $qacontact = 0;
my $name = trim($::FORM{'qa_contact'});
# The QA contact cannot be deleted from show_bug.cgi for a single bug!
if ($name ne $::FORM{'dontchange'}) {
$qacontact = DBNameToIdAndCheck($name) if ($name ne "");
DoComma();
- $::query .= "qa_contact = $qacontact";
+ if($qacontact) {
+ $::query .= "qa_contact = $qacontact";
+ }
+ else {
+ $::query .= "qa_contact = NULL";
+ }
}
}
@@ -967,9 +974,14 @@ SWITCH: for ($::FORM{'knob'}) {
if (Param("useqacontact")) {
SendSQL("SELECT initialqacontact FROM components " .
"WHERE components.id = $comp_id");
- $qacontact = FetchOneColumn() || 0;
+ $qacontact = FetchOneColumn();
DoComma();
- $::query .= "qa_contact = $qacontact";
+ if ($qacontact) {
+ $::query .= "qa_contact = $qacontact";
+ }
+ else {
+ $::query .= "qa_contact = NULL";
+ }
}
last SWITCH;
};