From aa60f3c8b1daee2eb35f73d86468324612d2ae32 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Tue, 24 Mar 2020 12:59:31 +0000 Subject: [PATCH] Merged r19613 from trunk to 4.1-stable (#33183). git-svn-id: http://svn.redmine.org/redmine/branches/4.1-stable@19614 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/custom_fields_helper.rb | 2 +- test/functional/users_controller_test.rb | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/helpers/custom_fields_helper.rb b/app/helpers/custom_fields_helper.rb index 48fc6140a..9aa1fa4d8 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 3081c0d7e..e83cef726 100644 --- a/test/functional/users_controller_test.rb +++ b/test/functional/users_controller_test.rb @@ -443,6 +443,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 => { -- 2.39.5