From 5d516a6ae2f021d2e276a842c24dff74d3448c45 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Tue, 10 Nov 2009 01:36:02 +0000 Subject: Bug 472217: Create a Bugzilla::Comment object and eliminate GetComments Patch by Max Kanat-Alexander r=LpSolit, a=LpSolit --- enter_bug.cgi | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'enter_bug.cgi') diff --git a/enter_bug.cgi b/enter_bug.cgi index 071276f1d..2ae05b4d6 100755 --- a/enter_bug.cgi +++ b/enter_bug.cgi @@ -434,17 +434,16 @@ 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. - # 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'}; + my $bug_desc = $cloned_bug->comments({ order => 'oldest_to_newest' })->[0]; + my $isprivate = $bug_desc->is_private; $vars->{'comment'} = ""; $vars->{'commentprivacy'} = 0; if (!$isprivate || Bugzilla->user->is_insider) { - $vars->{'comment'} = $bug_desc->[0]->{'body'}; + # We use "body" to avoid any format_comment text, which would be + # pointless to clone. + $vars->{'comment'} = $bug_desc->body; $vars->{'commentprivacy'} = $isprivate; } -- cgit v1.2.3-24-g4f1b