From 1ef6fbda0be6a7bae65392231295811394abf6c4 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" Date: Tue, 7 Feb 2006 22:25:23 +0000 Subject: [PATCH] =?UTF-8?q?Bug=20325048:=20[PostgreSQL]=20Changing=20the?= =?UTF-8?q?=20status=20of=20a=20bug=20from=20UNCONFIRMED=20to=20NEW=20or?= =?UTF-8?q?=20ASSIGNED=20sets=20everconfirmed=20to=201=20but=20leave=20the?= =?UTF-8?q?=20status=20as=20UNCONFIRMED=20-=20Patch=20by=20Fr=EF=BF=BDd?= =?UTF-8?q?=EF=BF=BDric=20Buclin=20=20r=3Dmkanat=20a=3D?= =?UTF-8?q?myk?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webtools/bugzilla/process_bug.cgi | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/webtools/bugzilla/process_bug.cgi b/webtools/bugzilla/process_bug.cgi index 79ad8e5177a5..a8a0f5f0dc5f 100755 --- a/webtools/bugzilla/process_bug.cgi +++ b/webtools/bugzilla/process_bug.cgi @@ -24,7 +24,7 @@ # Christopher Aillon # Myk Melez # Jeff Hedlund -# Frédéric Buclin +# Frédéric Buclin # Lance Larsh # Implementation notes for this file: @@ -742,10 +742,14 @@ sub DoComma { $::comma = ","; } +# $everconfirmed is used by ChangeStatus() to determine whether we are +# confirming the bug or not. +my $everconfirmed; sub DoConfirm { if (CheckCanChangeField("canconfirm", scalar $cgi->param('id'), 0, 1)) { DoComma(); $::query .= "everconfirmed = 1"; + $everconfirmed = 1; } } @@ -787,11 +791,18 @@ sub ChangeStatus { my @open_state = map(SqlQuote($_), OpenStates()); my $open_state = join(", ", @open_state); + + # If we are changing everconfirmed to 1, we have to take this change + # into account and the new bug status is given by $str. + my $cond = SqlQuote($str); + # If we are not setting everconfirmed, the new bug status depends on + # the actual value of everconfirmed, which is bug-specific. + unless ($everconfirmed) { + $cond = "(CASE WHEN everconfirmed = 1 THEN " . $cond . + " ELSE 'UNCONFIRMED' END)"; + } $::query .= "bug_status = CASE WHEN bug_status IN($open_state) THEN " . - "(CASE WHEN everconfirmed = 1 THEN " . - SqlQuote($str) . " ELSE " . - " 'UNCONFIRMED' END) ELSE " . - "bug_status END"; + $cond . " ELSE bug_status END"; } else { $::query .= "bug_status = " . SqlQuote($str); }