Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch for exception after issue creation #63

Open
mateuszdraco opened this issue Nov 4, 2010 · 2 comments
Open

Patch for exception after issue creation #63

mateuszdraco opened this issue Nov 4, 2010 · 2 comments

Comments

@mateuszdraco
Copy link

Creating issue on Dashboard site lead to exception. Solution:

/lib/hooks.rb
@@ -6,8 +6,13 @@ module RedmineSprints
     def controller_issues_new_before_save(context = {})
       context[:issue].user_story_id = context[:params][:issue][:user_story_id]
       if context[:issue].user_story_id && context[:issue].fixed_version_id
-        context[:issue].redirect_to = url_for(:controller => :sprints, :action => "show", :id => context[:issue].fixed_version_id, :project_id => context[:issue].project.identifier)+"/"+context[:issue].id
+       if context[:issue].id
+          context[:issue].redirect_to = url_for(:controller => :sprints, :action => "show", :id => context[:issue].fixed_version_id, :project_id => context[:issue].project.identifier)+"/"+context[:issue].id
+        else
+          context[:issue].redirect_to = url_for(:controller => :sprints, :action => "show", :id => context[:issue].fixed_version_id, :project_id => context[:issue].project.identifier)
+        end
+        puts ":controller_issues_new_before_save 99"
       end
     end
@pabloalba
Copy link

Thank you! This error was becoming me nuts!

@cleocir
Copy link

cleocir commented May 30, 2011

this path solved same problem with redmine 1.1.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants