Commit 210507c6 authored by jplang's avatar jplang

Private notes get copied without private flag to Duplicate issues (#22072).

git-svn-id: https://svn.redmine.org/redmine/trunk@15196 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent d9ee7c50
......@@ -1568,6 +1568,7 @@ class Issue < ActiveRecord::Base
# Same user and notes
if @current_journal
duplicate.init_journal(@current_journal.user, @current_journal.notes)
duplicate.private_notes = @current_journal.private_notes
end
duplicate.update_attribute :status, self.status
end
......
......@@ -1274,6 +1274,24 @@ class IssueTest < ActiveSupport::TestCase
assert issue3.reload.closed?
end
def test_should_close_duplicates_with_private_notes
issue = Issue.generate!
duplicate = Issue.generate!
IssueRelation.create!(:issue_from => duplicate, :issue_to => issue,
:relation_type => IssueRelation::TYPE_DUPLICATES)
assert issue.reload.duplicates.include?(duplicate)
# Closing issue with private notes
issue.init_journal(User.first, "Private notes")
issue.private_notes = true
issue.status = IssueStatus.where(:is_closed => true).first
assert_save issue
duplicate.reload
assert journal = duplicate.journals.detect {|journal| journal.notes == "Private notes"}
assert_equal true, journal.private_notes
end
def test_should_not_close_duplicated_issue
issue1 = Issue.generate!
issue2 = Issue.generate!
......
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