diff options
author | mkanat%kerio.com <> | 2005-04-05 04:40:58 +0000 |
---|---|---|
committer | mkanat%kerio.com <> | 2005-04-05 04:40:58 +0000 |
commit | d71d64d9372f1556cec96434179b4cb1f9668e92 (patch) | |
tree | a73bd8ddbed9693aa96bb7bac3749744bb31a4c8 /editcomponents.cgi | |
parent | Bug 285345: Need to change MySQL tinyint(1) fields to plain tinyint (diff) | |
download | bugzilla-d71d64d9372f1556cec96434179b4cb1f9668e92.tar.gz bugzilla-d71d64d9372f1556cec96434179b4cb1f9668e92.tar.bz2 bugzilla-d71d64d9372f1556cec96434179b4cb1f9668e92.zip |
Bug 287483: Sanitycheck screams about "Bad value 0 found in components.initialqacontact"
Patch By Teemu Mannermaa <wicked@etlicon.fi> r=mkanat, a=myk
Diffstat (limited to 'editcomponents.cgi')
-rwxr-xr-x | editcomponents.cgi | 8 |
1 files changed, 6 insertions, 2 deletions
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; |