summaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/issues_controller.rb14
1 files changed, 9 insertions, 5 deletions
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index 82fa5f8ea..e3e6ffedc 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -360,11 +360,15 @@ private
def build_new_issue_from_params
if params[:id].blank?
@issue = Issue.new
- begin
- @issue.copy_from(params[:copy_from]) if params[:copy_from]
- rescue ActiveRecord::RecordNotFound
- render_404
- return
+ if params[:copy_from]
+ begin
+ @copy_from = Issue.visible.find(params[:copy_from])
+ @copy_attachments = params[:copy_attachments].present? || request.get?
+ @issue.copy_from(@copy_from, :attachments => @copy_attachments)
+ rescue ActiveRecord::RecordNotFound
+ render_404
+ return
+ end
end
@issue.project = @project
else