summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2020-03-24 12:56:35 +0000
committerGo MAEDA <maeda@farend.jp>2020-03-24 12:56:35 +0000
commitd449409ab9e68796984f95998330de6ba810ded6 (patch)
treec3871ed2dac5010e74d6cb70d8c9d77b3931fd2b
parent1473996f92fd8e77af4736353bcb0190e79b144d (diff)
downloadredmine-d449409ab9e68796984f95998330de6ba810ded6.tar.gz
redmine-d449409ab9e68796984f95998330de6ba810ded6.zip
Unable to edit user or group that has custom fields with text formatting enabled (#33183).
Patch by Go MAEDA and Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@19613 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/helpers/custom_fields_helper.rb2
-rw-r--r--test/functional/users_controller_test.rb8
2 files changed, 9 insertions, 1 deletions
diff --git a/app/helpers/custom_fields_helper.rb b/app/helpers/custom_fields_helper.rb
index a6fbff9bd..5f5c057dc 100644
--- a/app/helpers/custom_fields_helper.rb
+++ b/app/helpers/custom_fields_helper.rb
@@ -86,7 +86,7 @@ module CustomFieldsHelper
data = {
:auto_complete => true,
:issues_url => auto_complete_issues_path(:project_id => custom_value.customized.project, :q => '')
- } if custom_value.customized && custom_value.customized.project
+ } if custom_value.customized&.try(:project)
end
custom_value.custom_field.format.edit_tag(
self,
diff --git a/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb
index 591dad943..36ca9539f 100644
--- a/test/functional/users_controller_test.rb
+++ b/test/functional/users_controller_test.rb
@@ -454,6 +454,14 @@ class UsersControllerTest < Redmine::ControllerTest
assert_response 404
end
+ def test_edit_user_with_full_text_formatting_custom_field_should_not_fail
+ field = UserCustomField.find(4)
+ field.update_attribute :text_formatting, 'full'
+
+ get :edit, :params => {:id => 2}
+ assert_response :success
+ end
+
def test_update
ActionMailer::Base.deliveries.clear
put :update, :params => {