When you change the value of a “Select One Value” Custom Field, you get
the messages:
* CFNAME A changed to B
* Custom field value A could not be found for custom field CFNAME
The second message is odd and misleading. The CF value is changed
anyway. Thanks to Eric Shultz for this - I just verified it in 3.6rc3
and generated a patch.
*** /usr/local/rt/lib/RT/Interface/Web.pm 2006-02-21 13:23:06.000000000
-0800
— Web_Local.pm 2006-06-08 10:47:39.900398608 -0700
*** 1230,1235 ****
— 1230,1237 ----
my $cf_values =
$Object->CustomFieldValues($cf);
my %values_hash;
-
my @addcfresults = (); foreach my $value (@values) { next unless length($value);
*** 1242,1260 ****
Value => $value
);
push ( @results, $msg );
}
}
! while ( my $cf_value = $cf_values->Next ) {
! unless ( $values_hash{ $cf_value->Content
} == 1 ) {
my ( $val, $msg ) =
$Object->DeleteCustomFieldValue(
Field => $cf,
Value => $cf_value->Content
);
push ( @results, $msg);
! }
! }
}
elsif ( $arg =~ /-Values$/ ) {
my $cf_values =
$Object->CustomFieldValues($cf);
— 1244,1265 ----
Value => $value
);
push ( @results, $msg );
-
push( @addcfresults, $msg ); } }
! if (!@addcfresults or
!$CustomFieldObj->MaxValues ) {
! while ( my $cf_value = $cf_values->Next ) {
! unless ( $values_hash{
$cf_value->Content } == 1 ) {
my ( $val, $msg ) =
$Object->DeleteCustomFieldValue(
Field => $cf,
Value => $cf_value->Content
);
push ( @results, $msg);
! }
! }
! }
}
elsif ( $arg =~ /-Values$/ ) {
my $cf_values =
$Object->CustomFieldValues($cf);
Philip Kime
NOPS Systems Architect
310 401 0407