summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkanat%kerio.com <>2005-04-05 06:40:58 +0200
committermkanat%kerio.com <>2005-04-05 06:40:58 +0200
commitd71d64d9372f1556cec96434179b4cb1f9668e92 (patch)
treea73bd8ddbed9693aa96bb7bac3749744bb31a4c8
parent9e7eef7da3b400f0cc22c848cb4968994f37753b (diff)
downloadbugzilla-d71d64d9372f1556cec96434179b4cb1f9668e92.tar.gz
bugzilla-d71d64d9372f1556cec96434179b4cb1f9668e92.tar.xz
Bug 287483: Sanitycheck screams about "Bad value 0 found in components.initialqacontact"
Patch By Teemu Mannermaa <wicked@etlicon.fi> r=mkanat, a=myk
-rwxr-xr-xchecksetup.pl10
-rwxr-xr-xeditcomponents.cgi8
2 files changed, 14 insertions, 4 deletions
diff --git a/checksetup.pl b/checksetup.pl
index a0a7835ba..b4f9fb930 100755
--- a/checksetup.pl
+++ b/checksetup.pl
@@ -3838,8 +3838,14 @@ add_setting ("display_quips", {"on" => 1, "off" => 2 }, "on" );
if (!$dbh->bz_get_field_def('bugs', 'qa_contact')->[2]) { # if it's NOT NULL
$dbh->bz_change_field_type('bugs', 'qa_contact', 'mediumint');
$dbh->do("UPDATE bugs SET qa_contact = NULL WHERE qa_contact = 0");
- $dbh->do("UPDATE components SET initialqacontact = NULL
- WHERE initialqacontact = 0");
+}
+
+# 2005-03-27 initialqacontact should be NULL instead of 0, bug 287483
+if (!$dbh->bz_get_field_def('components',
+ 'initialqacontact')->[2]) { # if it's NOT NULL
+ $dbh->bz_change_field_type('components', 'initialqacontact', 'mediumint');
+ $dbh->do("UPDATE components SET initialqacontact = NULL " .
+ "WHERE initialqacontact = 0");
}
# 2005-03-29 - gerv@gerv.net - bug 73665.
diff --git a/editcomponents.cgi b/editcomponents.cgi
index 9a1e7934e..a86329d9d 100755
--- a/editcomponents.cgi
+++ b/editcomponents.cgi
@@ -305,6 +305,8 @@ if ($action eq 'new') {
{'name' => $component});
}
}
+ my $initialqacontactsql =
+ $initialqacontact ne '' ? SqlQuote($initialqacontactid) : 'NULL';
# Add the new component
SendSQL("INSERT INTO components ( " .
@@ -314,7 +316,7 @@ if ($action eq 'new') {
SqlQuote($component) . "," .
SqlQuote($description) . "," .
SqlQuote($initialownerid) . "," .
- SqlQuote($initialqacontactid) . ")");
+ $initialqacontactsql . ")");
# Insert default charting queries for this product.
# If they aren't using charting, this won't do any harm.
@@ -611,9 +613,11 @@ if ($action eq 'update') {
ThrowUserError('component_need_valid_initialqacontact',
{'name' => $componentold});
}
+ my $initialqacontactsql =
+ $initialqacontact ne '' ? SqlQuote($initialqacontactid) : 'NULL';
SendSQL("UPDATE components
- SET initialqacontact=" . SqlQuote($initialqacontactid) . "
+ SET initialqacontact = $initialqacontactsql
WHERE id = $component_id");
$vars->{'updated_initialqacontact'} = 1;