Custom Fields (enumeration) Problem

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
Guest

Custom Fields (enumeration) Problem

Post 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
kerthi
Posts: 17
Joined: 08 Nov 2005, 14:31

Post 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
Guest

Post by Guest »

Damn it! I don't get this to work!
kerthi
Posts: 17
Joined: 08 Nov 2005, 14:31

Post 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.
Post Reply