From b5ae8cde2a4c1dc1fe6359690be9044ecb8b0b07 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Wed, 28 Jan 2009 23:27:27 +0000 Subject: =?UTF-8?q?Bug=20471523:=20Cloning=20a=20bug=20copies=20the=20newe?= =?UTF-8?q?st=20visible=20comment=20for=20Newest=20to=20Oldest=20comment?= =?UTF-8?q?=20order=20-=20Patch=20by=20Fr=C3=83=C2=A9d=C3=83=C2=A9ric=20Bu?= =?UTF-8?q?clin=20=20r=3Dmkanat=20a=3DLpSolit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- enter_bug.cgi | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'enter_bug.cgi') diff --git a/enter_bug.cgi b/enter_bug.cgi index d463a7a11..ef0314bca 100755 --- a/enter_bug.cgi +++ b/enter_bug.cgi @@ -422,14 +422,17 @@ if ($cloned_bug_id) { # We need to ensure that we respect the 'insider' status of # the first comment, if it has one. Either way, make a note # that this bug was cloned from another bug. - - my $isprivate = $cloned_bug->longdescs->[0]->{'isprivate'}; + # We cannot use $cloned_bug->longdescs because this method + # depends on the "comment_sort_order" user pref, and we + # really want the first comment of the bug. + my $bug_desc = Bugzilla::Bug::GetComments($cloned_bug_id, 'oldest_to_newest'); + my $isprivate = $bug_desc->[0]->{'isprivate'}; $vars->{'comment'} = ""; $vars->{'commentprivacy'} = 0; - if ( !($isprivate) || Bugzilla->user->is_insider ) { - $vars->{'comment'} = $cloned_bug->longdescs->[0]->{'body'}; + if (!$isprivate || Bugzilla->user->is_insider) { + $vars->{'comment'} = $bug_desc->[0]->{'body'}; $vars->{'commentprivacy'} = $isprivate; } -- cgit v1.2.1