GitLab steht wegen Wartungsarbeiten am Montag, den 10. Mai, zwischen 17:00 und 19:00 Uhr nicht zur Verfügung.

Commit 2680fe2e authored by jplang's avatar jplang

Fixed that issue author is assigned with current user when the edit form is updated (#11975).

git-svn-id: https://svn.redmine.org/redmine/trunk@10494 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 161b34fb
......@@ -398,7 +398,7 @@ private
end
@issue.project = @project
@issue.author = User.current
@issue.author ||= User.current
# Tracker must be set before custom field values
@issue.tracker ||= @project.trackers.find((params[:issue] && params[:issue][:tracker_id]) || params[:tracker_id] || :first)
if @issue.tracker.nil?
......
......@@ -2534,6 +2534,18 @@ class IssuesControllerTest < ActionController::TestCase
assert_equal 'This is the test_new issue', issue.subject
end
def test_update_edit_form_should_keep_issue_author
@request.session[:user_id] = 3
xhr :put, :new, :project_id => 1, :id => 1, :issue => {:subject => 'Changed'}
assert_response :success
assert_equal 'text/javascript', response.content_type
issue = assigns(:issue)
assert_equal User.find(2), issue.author
assert_equal 2, issue.author_id
assert_not_equal User.current, issue.author
end
def test_update_edit_form_should_propose_transitions_based_on_initial_status
@request.session[:user_id] = 2
WorkflowTransition.delete_all
......
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