# HG changeset patch # User luisf # Date 1313702839 -3600 # Node ID c7559c3a8d0311f0505923b7f8683128f97ea6ca # Parent bdaabf6ee5914c721ddc406e2d342f2e3d9a8897 Fixed a bug when a validation error occurs: keeps the project_id so that the publication is still saved in the same circumstances. diff -r bdaabf6ee591 -r c7559c3a8d03 vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb --- a/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Thu Aug 18 17:44:12 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Thu Aug 18 22:27:19 2011 +0100 @@ -16,20 +16,14 @@ @publication.build_bibtex_entry # and at least one author - # @publication.authorships.build.build_author - - @project_id = params[:project_id] - @current_user = User.current - + # @publication.authorships.build.build_author @author_options = Authorship.like_unique(User.name).find(:all, :limit => 100) end def create - find_project_by_project_id - + @project_id = params[:project_id] @author_options = Authorship.like_unique(User.name).find(:all, :limit => 100) - - + @publication = Publication.new(params[:publication]) # @project = Project.find(params[:project_id]) @@ -39,7 +33,7 @@ flash[:notice] = "Successfully created publication." redirect_to :action => :show, :id => @publication, :project_id => @project.id else - render :action => 'new' + render :action => 'new', :project_id => @project_id end end