mirror of
https://github.com/meineerde/redmine.git
synced 2026-02-03 23:53:23 +00:00
Internal error when moving an issue to a project without trackers (#20463).
git-svn-id: http://svn.redmine.org/redmine/trunk@14612 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
49604a3bae
commit
a5de0fec9e
@ -873,6 +873,11 @@ class Issue < ActiveRecord::Base
|
||||
end
|
||||
end
|
||||
|
||||
# Returns the original tracker
|
||||
def tracker_was
|
||||
Tracker.find_by_id(tracker_id_was)
|
||||
end
|
||||
|
||||
# Returns the users that should be notified
|
||||
def notified_users
|
||||
notified = []
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<h2><%= "#{@issue.tracker.name} ##{@issue.id}" %></h2>
|
||||
<h2><%= "#{@issue.tracker_was} ##{@issue.id}" %></h2>
|
||||
|
||||
<%= render :partial => 'edit' %>
|
||||
<% content_for :header_tags do %>
|
||||
|
||||
@ -3057,6 +3057,17 @@ class IssuesControllerTest < ActionController::TestCase
|
||||
assert_mail_body_match "Project changed from eCookbook to OnlineStore", mail
|
||||
end
|
||||
|
||||
def test_put_update_trying_to_move_issue_to_project_without_tracker_should_not_error
|
||||
target = Project.generate!(:tracker_ids => [])
|
||||
assert target.trackers.empty?
|
||||
issue = Issue.generate!
|
||||
@request.session[:user_id] = 1
|
||||
|
||||
put :update, :id => issue.id, :issue => {:project_id => target.id}
|
||||
assert_response :success
|
||||
assert_template 'edit'
|
||||
end
|
||||
|
||||
def test_put_update_with_tracker_change
|
||||
@request.session[:user_id] = 2
|
||||
ActionMailer::Base.deliveries.clear
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user