]> source.dussan.org Git - redmine.git/commitdiff
Fixed: should redirect to the new project when copying a project.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 2 Jan 2011 11:42:37 +0000 (11:42 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 2 Jan 2011 11:42:37 +0000 (11:42 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4616 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/projects_controller.rb
test/functional/projects_controller_test.rb

index 2547d61669ced5b7b7024fa29a826600a3cb29ec..420801c0129251c1c266d662744d82661a930934 100644 (file)
@@ -124,13 +124,13 @@ class ProjectsController < ApplicationController
         if validate_parent_id && @project.copy(@source_project, :only => params[:only])
           @project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id')
           flash[:notice] = l(:notice_successful_create)
-          redirect_to :controller => 'projects', :action => 'settings'
+          redirect_to :controller => 'projects', :action => 'settings', :id => @project
         elsif !@project.new_record?
           # Project was created
           # But some objects were not copied due to validation failures
           # (eg. issues from disabled trackers)
           # TODO: inform about that
-          redirect_to :controller => 'projects', :action => 'settings'
+          redirect_to :controller => 'projects', :action => 'settings', :id => @project
         end
       end
     end
index 1e0aaaaa3ba9944543177488b1980228d3d94ba9..aaf6e308530307d814be537177b250de58133648 100644 (file)
@@ -429,7 +429,7 @@ class ProjectsControllerTest < ActionController::TestCase
       @request.session[:user_id] = 1 # admin
       post :copy, :id => 1, :project => {:name => 'Copy', :identifier => 'unique-copy'}
       assert_response :redirect
-      assert_redirected_to :controller => 'projects', :action => 'settings'
+      assert_redirected_to :controller => 'projects', :action => 'settings', :id => 'unique-copy'
     end
   end