From 1bda8ce9405f3568298afe86612338299c88abb6 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 31 Dec 2016 15:26:00 +0000 Subject: Don't show the "reassign" option when deleting issues from different projects (#24722). git-svn-id: http://svn.redmine.org/redmine/trunk@16121 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/issues_controller.rb | 2 +- app/views/issues/destroy.html.erb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 2a69d57ff..0b99eb526 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -356,7 +356,7 @@ class IssuesController < ApplicationController when 'nullify' time_entries.update_all(:issue_id => nil) when 'reassign' - reassign_to = @project.issues.find_by_id(params[:reassign_to_id]) + reassign_to = @project && @project.issues.find_by_id(params[:reassign_to_id]) if reassign_to.nil? flash.now[:error] = l(:error_issue_not_found_in_project) return diff --git a/app/views/issues/destroy.html.erb b/app/views/issues/destroy.html.erb index 4a0631e68..83da014cd 100644 --- a/app/views/issues/destroy.html.erb +++ b/app/views/issues/destroy.html.erb @@ -7,8 +7,10 @@



+<% if @project %> <%= text_field_tag 'reassign_to_id', params[:reassign_to_id], :size => 6, :onfocus => '$("#todo_reassign").attr("checked", true);' %> +<% end %>

<%= submit_tag l(:button_apply) %> -- cgit v1.2.3