Project

General

Profile

Actions

Defect #39756

closed

ActionView::Template::Error (undefined method `editable' for #<UserCustomField>

Added by Sven Culley 6 months ago. Updated 6 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Custom fields
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

Description

I try to add a custom field to a user which results in a "Internal Server Error"

Reproduce:
  1. Open http://domain.tld/custom_fields/new?tab=IssueCustomField
    1. Select "Users"
  2. Click "Next"
  3. Error message is shown
[552a7584-417b-4565-833b-2a17aa22cb7e] ActionView::Template::Error (undefined method `editable' for #<UserCustomField:0x000055ca2a870678>
Did you mean?  edit_tag_style):
[552a7584-417b-4565-833b-2a17aa22cb7e]     39:     <% end %>
[552a7584-417b-4565-833b-2a17aa22cb7e]     40: 
[552a7584-417b-4565-833b-2a17aa22cb7e]     41:     <% if @custom_field.is_a?(UserCustomField) %>
[552a7584-417b-4565-833b-2a17aa22cb7e]     42:       <p><%= f.check_box :editable %></p>
[552a7584-417b-4565-833b-2a17aa22cb7e]     43:     <% end %>
[552a7584-417b-4565-833b-2a17aa22cb7e]     44: 
[552a7584-417b-4565-833b-2a17aa22cb7e]     45:     <% if %w(IssueCustomField UserCustomField ProjectCustomField VersionCustomField GroupCustomField TimeEntryCustomField).include?(@custom_field.class.name) &&
[552a7584-417b-4565-833b-2a17aa22cb7e]   
[552a7584-417b-4565-833b-2a17aa22cb7e] lib/redmine/views/labelled_form_builder.rb:36:in `check_box'
[552a7584-417b-4565-833b-2a17aa22cb7e] app/views/custom_fields/_form.html.erb:42
[552a7584-417b-4565-833b-2a17aa22cb7e] app/views/custom_fields/new.html.erb:4
[552a7584-417b-4565-833b-2a17aa22cb7e] app/helpers/application_helper.rb:1483:in `labelled_form_for'
[552a7584-417b-4565-833b-2a17aa22cb7e] app/views/custom_fields/new.html.erb:3
[552a7584-417b-4565-833b-2a17aa22cb7e] lib/redmine/sudo_mode.rb:61:in `sudo_mode'

Technical environment

Environment:
  1. Redmine version 5.0.7.stable
  2. Ruby version 2.7.4-p191 (2021-07-07) [x86_64-linux-gnu]
  3. Rails version 6.1.7.6
  4. Environment production
  5. Database adapter Mysql2
  6. Mailer queue ActiveJob::QueueAdapters::AsyncAdapter
  7. Mailer delivery smtp
Redmine plugins:
  1. additionals 3.0.8-main
  2. redmine_messenger 1.0.14
  3. redmine_spent_time 4.1.0
  4. view_customize 3.2.0

Anyone a suggestion what might be the problem?

Actions

Also available in: Atom PDF