From 3e31f8167be6abb5afb5439a8c531e3107cefbf3 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 17 Jun 2018 06:22:35 +0000 Subject: Cannot clear category field on copying an Issue (#28951). git-svn-id: http://svn.redmine.org/redmine/trunk@17395 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/issue.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/models/issue.rb b/app/models/issue.rb index d37486c97..91f53c19e 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -530,7 +530,7 @@ class Issue < ActiveRecord::Base self.project_id = p_id end - if project_id_changed? && attrs['category_id'].to_s == category_id_was.to_s + if project_id_changed? && attrs['category_id'].present? && attrs['category_id'].to_s == category_id_was.to_s # Discard submitted category on previous project attrs.delete('category_id') end -- cgit v1.2.3