]> source.dussan.org Git - redmine.git/commitdiff
Unable to edit user or group that has custom fields with text formatting enabled...
authorGo MAEDA <maeda@farend.jp>
Tue, 24 Mar 2020 12:56:35 +0000 (12:56 +0000)
committerGo MAEDA <maeda@farend.jp>
Tue, 24 Mar 2020 12:56:35 +0000 (12:56 +0000)
Patch by Go MAEDA and Marius BALTEANU.

git-svn-id: http://svn.redmine.org/redmine/trunk@19613 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/custom_fields_helper.rb
test/functional/users_controller_test.rb

index a6fbff9bdea24e2b9d9083f1818c51872ba275ed..5f5c057dc665cd0f78569b564ba28f0efeca0fb6 100644 (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,
index 591dad9437139305ba3c4c77b053393445903481..36ca9539f997668fc268130d2a43727897a8ca89 100644 (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 => {