]> source.dussan.org Git - redmine.git/commitdiff
Fixed: trying to preview a new issue raises an exception with postgresql (close ...
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 3 Apr 2008 13:16:51 +0000 (13:16 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 3 Apr 2008 13:16:51 +0000 (13:16 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1322 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/issues_controller.rb
app/views/issues/new.rhtml

index 269e988d90872f72699e6119090ce0038cd02a80..b3f21fddf00bc08962da9753ae34e4284e282520 100644 (file)
@@ -344,8 +344,8 @@ class IssuesController < ApplicationController
   end
   
   def preview
-    issue = @project.issues.find_by_id(params[:id])
-    @attachements = issue.attachments if issue
+    @issue = @project.issues.find_by_id(params[:id]) if params[:id]
+    @attachements = issue.attachments if @issue
     @text = params[:notes] || (params[:issue] ? params[:issue][:description] : nil)
     render :partial => 'common/preview'
   end
index 7b9dde899f5a655dba524131167e442174a4698d..280e2009bddf37742761f57446af44814c951994 100644 (file)
@@ -8,7 +8,7 @@
     </div>
     <%= submit_tag l(:button_create) %>
     <%= 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',
                          :update => 'preview',
                          :with => "Form.serialize('issue-form')",