Project

General

Profile

Actions

Defect #27543

closed

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

Defect #27543: Key/value-pair custom field type not available to all customisable contents

Added by Felix Schäfer about 9 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Custom fields
Target version:
Resolution:
Fixed
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

Updated by Go MAEDA almost 9 years ago Actions #1

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

Updated by Takenori TAKAKI almost 3 years ago Actions #2

+1
I agree with @Felix Improvement.
I attach a patch with additional tests.

Updated by Takenori TAKAKI almost 3 years ago Actions #3

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

Updated by Go MAEDA almost 3 years ago Actions #4

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

Setting the target version to 6.0.0.

Updated by Go MAEDA over 2 years ago Actions #5

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the patch in r22834. Thank you.

Actions

Also available in: PDF Atom