]> source.dussan.org Git - redmine.git/commitdiff
Return to version page after the issue is created (#28138).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 19 Oct 2019 10:23:06 +0000 (10:23 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 19 Oct 2019 10:23:06 +0000 (10:23 +0000)
Patch by Marius BALTEANU.

git-svn-id: http://svn.redmine.org/redmine/trunk@18756 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/versions_helper.rb
test/helpers/version_helper_test.rb

index cb7b61ffcd1f2869f1f5e77d482ee255d44bb572..42dd6affd84adecc537443a2f4bf9331054d7462 100644 (file)
@@ -100,7 +100,7 @@ module VersionsHelper
           :tracker_id => new_issue_tracker,
           :fixed_version_id => version.id
         }
-        link_to l(:label_issue_new), new_project_issue_path(project, :issue => attrs), :class => 'icon icon-add'
+        link_to l(:label_issue_new), new_project_issue_path(project, :issue => attrs, :back_url => version_path(version)), :class => 'icon icon-add'
       end
     end
   end
index 9bdb4974966fdcfc406646d2586f435456f89d06..697ed574663a3fc2a99d9152b9006ef9f9e3b0d1 100644 (file)
@@ -62,7 +62,7 @@ class VersionsHelperTest < Redmine::HelperTest
     # href should contain the following params:
     # fixed_version_id=3
     # tracker_id=1
-    assert_select_in link_to_new_issue(version, project), '[href=?]', '/projects/ecookbook/issues/new?issue%5Bfixed_version_id%5D=3&issue%5Btracker_id%5D=1', :text => 'New issue'
+    assert_select_in link_to_new_issue(version, project), '[href=?]', '/projects/ecookbook/issues/new?back_url=%2Fversions%2F3&issue%5Bfixed_version_id%5D=3&issue%5Btracker_id%5D=1', :text => 'New issue'
   end
 
   def test_link_to_new_issue_should_return_nil_if_version_status_is_not_open
@@ -107,6 +107,6 @@ class VersionsHelperTest < Redmine::HelperTest
     User.current = User.find(2)
 
     # href should contain param tracker_id=2 because for tracker_id 1, user has only readonly permissions on fixed_version_id
-    assert_select_in link_to_new_issue(version, project), '[href=?]', '/projects/ecookbook/issues/new?issue%5Bfixed_version_id%5D=3&issue%5Btracker_id%5D=2'
+    assert_select_in link_to_new_issue(version, project), '[href=?]', '/projects/ecookbook/issues/new?back_url=%2Fversions%2F3&issue%5Bfixed_version_id%5D=3&issue%5Btracker_id%5D=2'
   end
 end