PATCH: Select One Value CFs give misleading error in 3.6rc3

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

This should make it into 3.6.1. (we’re only fixing critical bugs for 3.6.0) Thanks!
Best,
Jesse
This message was sent from my Treo. Please accept my apologies for its brevity and for any typos.-----Original Message-----
From: “Philip Kime” pkime@Shopzilla.com
Date: Thursday, Jun 8, 2006 1:46 pm
Subject: [Rt-devel] PATCH: Select One Value CFs give misleading error in 3.6rc3

This is a multi-part message in MIME format.