From: lpsolit%gmail.com <> Date: Wed, 28 Jan 2009 23:29:19 +0000 (+0000) Subject: Bug 471523: Cloning a bug copies the newest visible comment for Newest to Oldest... X-Git-Tag: bugzilla-3.2.1~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d3b0bb9d844a016480b4a97be916b8908769f901;p=thirdparty%2Fbugzilla.git Bug 471523: Cloning a bug copies the newest visible comment for Newest to Oldest comment order - Patch by Frédéric Buclin r=mkanat a=LpSolit --- diff --git a/enter_bug.cgi b/enter_bug.cgi index 5b581bc2aa..ca9b39a17c 100755 --- a/enter_bug.cgi +++ b/enter_bug.cgi @@ -417,14 +417,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; }