[rt-users] RE: Strange message when changing "Select One Value" CFs inRT 3.4.5
Schultz, Eric
ESchultz at corp.untd.com
Wed Jun 7 21:13:53 EDT 2006
I don't know what to tell you about the asset tracker code. Maybe you
can use the RT code as a hint for how to fix the AT code.
Eric Schultz
United Online
-----Original Message-----
From: Philip Kime [mailto:pkime at Shopzilla.com]
Sent: Wednesday, June 07, 2006 5:54 PM
To: Schultz, Eric; RT users
Subject: RE: Strange message when changing "Select One Value" CFs inRT
3.4.5
Hmm, I tried this but get the same message. However, I'm only seeing
this behaviour with Custom Fields in Assets, not Tickets it seems ...
PK
-----Original Message-----
From: Schultz, Eric [mailto:ESchultz at corp.untd.com]
Sent: 07 June 2006 12:38
To: Philip Kime; RT users
Subject: RE: [rt-users] Strange message when changing "Select One Value"
CFs inRT 3.4.5
Since I've made a number of other changes, I can't just give you a
patch. But yes, I thought it was a bug, and I fixed it thusly in
/path/to/your/rt/lib/RT/Interface/Web.pm (this also works for something
that isn't a "select one value"):
@@ -1217,6 +1217,8 @@
my $cf_values = $Object->CustomFieldValues($cf);
my %values_hash;
+ my @addcfresults = ();
+
foreach my $value (@values) {
next unless length($value);
@@ -1229,17 +1231,20 @@
Value => $value
);
push ( @results, $msg );
+ push( @addcfresults, $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);
+ 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);
+ }
}
}
}
Let me know if another diff type would be clearer for you to make the
change to your code.
Eric Schultz
United Online
-----Original Message-----
From: rt-users-bounces at lists.bestpractical.com
[mailto:rt-users-bounces at lists.bestpractical.com] On Behalf Of Philip
Kime
Sent: Sunday, June 04, 2006 2:37 PM
To: RT users
Subject: [rt-users] Strange message when changing "Select One Value" CFs
inRT 3.4.5
If I change a "Select one value" CF in RT 3.4.5, I get two messages, for
example:
* ClusterCountryCode FR changed to US
* Custom field value FR could not be found for custom field
ClusterCountryCode
The change is fine and works but the second message is odd (it comes
from CustomField_Overlay.pm) - it looks like it tries to change it twice
and fails the second time because the value is already changed? Any
comments? Is this a bug?
PK
--
Philip Kime
NOPS Systems Architect
310 401 0407
More information about the rt-users
mailing list