diff options
author | mkanat%bugzilla.org <> | 2009-11-10 01:36:02 +0000 |
---|---|---|
committer | mkanat%bugzilla.org <> | 2009-11-10 01:36:02 +0000 |
commit | 5d516a6ae2f021d2e276a842c24dff74d3448c45 (patch) | |
tree | d4aebc8e20cc8d207834d36b9663b87ecf593714 /enter_bug.cgi | |
parent | 88a69f2048d03b845e8e04fd23b1141df9fb8ee1 (diff) | |
download | bugs-5d516a6ae2f021d2e276a842c24dff74d3448c45.tar bugs-5d516a6ae2f021d2e276a842c24dff74d3448c45.tar.gz bugs-5d516a6ae2f021d2e276a842c24dff74d3448c45.tar.bz2 bugs-5d516a6ae2f021d2e276a842c24dff74d3448c45.tar.xz bugs-5d516a6ae2f021d2e276a842c24dff74d3448c45.zip |
Bug 472217: Create a Bugzilla::Comment object and eliminate GetComments
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
Diffstat (limited to 'enter_bug.cgi')
-rwxr-xr-x | enter_bug.cgi | 11 |
1 files changed, 5 insertions, 6 deletions
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; } |