From 045e964867ae036ddc7d5b41a03dd48d8f291ee7 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Sun, 20 Aug 2006 03:56:50 +0000 Subject: Bug 346241: Make series.creator nullable in the DB and use NULL for series with creator 0 - Patch by RĂ©mi Zara r=wicked a=myk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bugzilla/Series.pm | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'Bugzilla/Series.pm') diff --git a/Bugzilla/Series.pm b/Bugzilla/Series.pm index 4693a7131..011e60168 100644 --- a/Bugzilla/Series.pm +++ b/Bugzilla/Series.pm @@ -36,8 +36,6 @@ use Bugzilla::Error; use Bugzilla::Util; use Bugzilla::User; -use constant PUBLIC_USER_ID => 0; - sub new { my $invocant = shift; my $class = ref($invocant) || $invocant; @@ -201,10 +199,9 @@ sub writeToDatabase { # Insert the new series into the series table $dbh->do("INSERT INTO series (creator, category, subcategory, " . "name, frequency, query, is_public) VALUES " . - "($self->{'creator'}, " . - "$category_id, $subcategory_id, " . - $dbh->quote($self->{'name'}) . ", $self->{'frequency'}," . - $dbh->quote($self->{'query'}) . ", $self->{'public'})"); + "(?, ?, ?, ?, ?, ?, ?)", undef, + $self->{'creator'}, $category_id, $subcategory_id, $self->{'name'}, + $self->{'frequency'}, $self->{'query'}, $self->{'public'}); # Retrieve series_id $self->{'series_id'} = $dbh->selectrow_array("SELECT MAX(series_id) " . -- cgit v1.2.3-24-g4f1b