diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-12-20 10:11:07 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-12-20 10:11:07 +0000 |
commit | 48afc0b15116d0ce47f12996b8d832f3c5f19427 (patch) | |
tree | 22e18e3e8ac645413c662ffc3261b3e7c70ffdcf | |
parent | 5ab9e10e7aeb24977a39d6fbefaaca4ee995fff6 (diff) | |
download | redmine-48afc0b15116d0ce47f12996b8d832f3c5f19427.tar.gz redmine-48afc0b15116d0ce47f12996b8d832f3c5f19427.zip |
Private note flag disappears in issue update conflict (#21551).
git-svn-id: http://svn.redmine.org/redmine/trunk@14984 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/controllers/issues_controller.rb | 2 | ||||
-rw-r--r-- | test/functional/issues_controller_transaction_test.rb | 21 |
2 files changed, 22 insertions, 1 deletions
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index f2dd1acd2..29fc0c9f3 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -388,7 +388,7 @@ class IssuesController < ApplicationController issue_attributes = issue_attributes.dup issue_attributes.delete(:lock_version) when 'add_notes' - issue_attributes = issue_attributes.slice(:notes) + issue_attributes = issue_attributes.slice(:notes, :private_notes) when 'cancel' redirect_to issue_path(@issue) return false diff --git a/test/functional/issues_controller_transaction_test.rb b/test/functional/issues_controller_transaction_test.rb index b38b09641..603b44a12 100644 --- a/test/functional/issues_controller_transaction_test.rb +++ b/test/functional/issues_controller_transaction_test.rb @@ -210,6 +210,27 @@ class IssuesControllerTransactionTest < ActionController::TestCase assert_nil issue.fixed_version_id journal = Journal.order('id DESC').first assert_equal 'add_notes_conflict_resolution', journal.notes + assert_equal false, journal.private_notes + assert journal.details.empty? + end + + def test_update_stale_issue_with_add_notes_conflict_resolution_should_preserve_private_notes + @request.session[:user_id] = 2 + + journal = new_record(Journal) do + put :update, :id => 1, + :issue => { + :fixed_version_id => 4, + :notes => 'add_privates_notes_conflict_resolution', + :private_notes => '1', + :lock_version => 2 + }, + :conflict_resolution => 'add_notes' + end + + assert_response 302 + assert_equal 'add_privates_notes_conflict_resolution', journal.notes + assert_equal true, journal.private_notes assert journal.details.empty? end |