Page 1 of 1

Custom Fields (enumeration) Problem

Posted: 08 Nov 2005, 14:34
by Guest
Hey!

I have the following problem:

I'm using several custom fields of type enumeration.
The fields are displayed in submit and update mode of the bug.

When i select a value and sumbit it. The right value is stored in the db.

When i enter the update mode of the bug. Always the first value of the enumeration is displayed. Not that one stored in the db.

How can i fix this?

greez kerthi

Posted: 09 Nov 2005, 06:40
by kerthi
Can noone help with this?


The statement that should ensure that the value is selected (lines 1174-1180 in custom_field_api):

foreach( $t_values as $t_option ) {
if( in_array( $t_option, $t_selected_values ) ) {
echo '<option value="' . $t_option . '" selected> ' . $t_option . '</option>';
} else {
echo '<option value="' . $t_option . '">' . $t_option . '</option>';
}
}


if( in_array( $t_option, $t_selected_values ) ) sheems never to be true. Because no enum never gets a selected val even with a selection stored in the db.

kerthi

Posted: 15 Nov 2005, 07:38
by Guest
Damn it! I don't get this to work!

Posted: 15 Nov 2005, 10:14
by kerthi
Solved it:

The possible values of the enumeration (custom field) have to look like:

|Value1|Value2|Value3

not

| Value1 | Value2 | Value3


for some Reason the second doesn't work.