Project

General

Profile

Where and how is Custom Field (List) rendered?

Added by Rahul Khemlani over 8 years ago

Hi,

I am trying to find the code which renders (grabs) the values that one defines when creating a Custom Field (List) and displays it in a particular page, Issues for example.

I believe that it is being rendered LOC starting on 139 in

 app\helpers\custom_fields_helper.rb 
and is being displayed using (in Issues page as the Custom field was set for Issues page)
 app\views\issues\_form_custom_fields.html.erb

I would like play around with it and see if I can hard code the values, but I have been unsuccessful so far.

Any help is appreciated.


Replies (4)

RE: Where and how is Custom Field (List) rendered? - Added by Kush Suryavanshi over 8 years ago

Hi Rahul,
What do you mean by hard coding? I believe the values for custom fields are stores in database.

RE: Where and how is Custom Field (List) rendered? - Added by Rahul Khemlani over 8 years ago

Hi Kush,

Thank you for your reply. Yes, I do realise that the values are stored in the database. I looked up the table, and that is, in fact, correct.

I am testing out a functionality that requires me to know where exactly are the values from the database grabbed and processed. I have been looking over this for a few days now and there seems to be a lot of methods and it is a little confusing.

Thanks.

RE: Where and how is Custom Field (List) rendered? - Added by Kush Suryavanshi over 8 years ago

Hi Rahul,
I am still learning Redmine code myself so I need to research a bit. But, may be you need to look at
models/custom_field.rb - In here, maybe possible_values or possible_values_options is what you may be looking for.

RE: Where and how is Custom Field (List) rendered? - Added by Rahul Khemlani over 8 years ago

Hi Kush,

Thank you for the reply again. I worked it out, but yes you are correct. The possible_values method calls the Gems which do the fetching and it also returns those fetched values in the end.

Thank you.

I am working on this Request - #6717, might submit the code here once I am done.

    (1-4/4)