Project

General

Profile

Actions

Defect #27543

open

Key/value-pair custom field type not available to all customisable contents

Added by Felix Schäfer over 6 years ago. Updated 2 months ago.

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

0%

Estimated time:
Resolution:
Affected version:

Description

The key/value-pair custom field type is currently limited to the same customisable contents as User and Version custom fields. For the key/value-pair custom field type this limitation is not necessary as the key/value-pairs are not project dependant.

The following patch removes the limitation inherited from the RecordList in the EnumerationFormat.

--- a/lib/redmine/field_format.rb
+++ b/lib/redmine/field_format.rb
@@ -723,6 +723,8 @@ module Redmine
     end

     class EnumerationFormat < RecordList
+      self.customized_class_names = nil
+
       add 'enumeration'
       self.form_partial = 'custom_fields/formats/enumeration'

Another possibility would be to move the limitation from the parent class RecordList to the child classes that need it (UserFormat, VersionFormat), but that would mean that other existing subclasses (e.g. from plugins) would need to be updated if they rely on this limitation.


Files

Actions #1

Updated by Go MAEDA over 6 years ago

  • Category set to Custom fields
  • Target version set to Candidate for next major release
Actions #2

Updated by Takenori TAKAKI 2 months ago

+1
I agree with Felix Schäfer Improvement.
I attach a patch with additional tests.

Actions #3

Updated by Takenori TAKAKI 2 months ago

I attach a patch that adds tests to ensure the functionality introduced in note-2 operates as expected.

Actions #4

Updated by Go MAEDA 2 months ago

  • Target version changed from Candidate for next major release to 6.0.0

Setting the target version to 6.0.0.

Actions

Also available in: Atom PDF