Commit b5ae8cde authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 471523: Cloning a bug copies the newest visible comment for Newest to Oldest…

Bug 471523: Cloning a bug copies the newest visible comment for Newest to Oldest comment order - Patch by Fré©ric Buclin <LpSolit@gmail.com> r=mkanat a=LpSolit
parent 70f22ae4
...@@ -422,14 +422,17 @@ if ($cloned_bug_id) { ...@@ -422,14 +422,17 @@ if ($cloned_bug_id) {
# We need to ensure that we respect the 'insider' status of # We need to ensure that we respect the 'insider' status of
# the first comment, if it has one. Either way, make a note # the first comment, if it has one. Either way, make a note
# that this bug was cloned from another bug. # that this bug was cloned from another bug.
# We cannot use $cloned_bug->longdescs because this method
my $isprivate = $cloned_bug->longdescs->[0]->{'isprivate'}; # 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->{'comment'} = "";
$vars->{'commentprivacy'} = 0; $vars->{'commentprivacy'} = 0;
if ( !($isprivate) || Bugzilla->user->is_insider ) { if (!$isprivate || Bugzilla->user->is_insider) {
$vars->{'comment'} = $cloned_bug->longdescs->[0]->{'body'}; $vars->{'comment'} = $bug_desc->[0]->{'body'};
$vars->{'commentprivacy'} = $isprivate; $vars->{'commentprivacy'} = $isprivate;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment