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
This commit is contained in:
Go MAEDA
2020-03-24 12:56:35 +00:00
parent 1473996f92
commit d449409ab9
2 changed files with 9 additions and 1 deletions

View File

@@ -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,

View File

@@ -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 => {