Fixed: trying to preview a new issue raises an exception with postgresql (close #984).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1322 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2008-04-03 13:16:51 +00:00
parent 6348eeaf8a
commit 7f0aa56119
2 changed files with 3 additions and 3 deletions

View File

@ -344,8 +344,8 @@ class IssuesController < ApplicationController
end end
def preview def preview
issue = @project.issues.find_by_id(params[:id]) @issue = @project.issues.find_by_id(params[:id]) if params[:id]
@attachements = issue.attachments if issue @attachements = issue.attachments if @issue
@text = params[:notes] || (params[:issue] ? params[:issue][:description] : nil) @text = params[:notes] || (params[:issue] ? params[:issue][:description] : nil)
render :partial => 'common/preview' render :partial => 'common/preview'
end end

View File

@ -8,7 +8,7 @@
</div> </div>
<%= submit_tag l(:button_create) %> <%= submit_tag l(:button_create) %>
<%= link_to_remote l(:label_preview), <%= link_to_remote l(:label_preview),
{ :url => { :controller => 'issues', :action => 'preview', :project_id => @project, :id => @issue }, { :url => { :controller => 'issues', :action => 'preview', :project_id => @project },
:method => 'post', :method => 'post',
:update => 'preview', :update => 'preview',
:with => "Form.serialize('issue-form')", :with => "Form.serialize('issue-form')",