Defect #8615

Custom 'version' fields don't show shared versions

Added by Dmitry Salashnik over 6 years ago. Updated about 6 years ago.

Status:ClosedStart date:2011-06-15
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Custom fields
Target version:1.2.2
Resolution:Fixed Affected version:1.2.1

Description

subj.

for fix i change in file app\models\custom_fields.rb:

  def possible_values_options(obj=nil)
    case field_format
    when 'user', 'version'
      if obj.respond_to?(:project) && obj.project
        case field_format
        when 'user'
          obj.project.users.sort.collect {|u| [u.to_s, u.id.to_s]}
        when 'version'
          # CHANGES HERE (versions -> shared versions)
          obj.project.shared_versions.sort.collect {|u| [u.to_s, u.id.to_s]} 
        end
      elsif obj.is_a?(Array)
        obj.collect {|o| possible_values_options(o)}.inject {|memo, v| memo & v}
      else
        []
      end
    else
      read_attribute :possible_values
    end
  end


Related issues

Duplicated by Redmine - Defect #8483: Content in the new custom field "referencing version tabl... Closed 2011-06-01

Associated revisions

Revision 7772
Added by Jean-Philippe Lang about 6 years ago

Fixed: Custom 'version' field don't show shared versions (#8615).

Revision 7773
Added by Jean-Philippe Lang about 6 years ago

Merged r7772 from trunk (#8615).

Revision 7774
Added by Jean-Philippe Lang about 6 years ago

Fixed failure introduced in r7772 (#8615).

Revision 7775
Added by Jean-Philippe Lang about 6 years ago

Merged r7774 from trunk (#8615).

History

#1 Updated by Etienne Massip over 6 years ago

  • Category set to Custom fields

#2 Updated by Gilles Cornu over 6 years ago

+1

I also applied this patch, which is quite 'natural' when you use version sharing option. It could be nice to let configure the custom field type 'version' between two modes :
  • project versions only
    OR
  • shared versions

#3 Updated by Vili Kosednar about 6 years ago

Hi,

how to make it show only not closed shared versions in the custom field?

brv

#4 Updated by Jean-Philippe Lang about 6 years ago

  • Tracker changed from Patch to Defect
  • Subject changed from Custom 'version' field don't show shared versions to Custom 'version' fields don't show shared versions
  • Status changed from New to Closed
  • Target version set to 1.2.2
  • Affected version (unused) set to 1.2.1
  • Resolution set to Fixed
  • Affected version set to 1.2.1

Fixed in r7772 with tests and merged in 1.2-stable.
Thanks.

Also available in: Atom PDF