[Rt-commit] r8130 - rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Interface

ruz at bestpractical.com ruz at bestpractical.com
Wed Jul 11 20:36:57 EDT 2007


Author: ruz
Date: Wed Jul 11 20:36:56 2007
New Revision: 8130

Modified:
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Interface/Web.pm

Log:
* when we replace a set of custom field values for an object with another
  set instead of comparing values by thier content compare them by id
  of ObjectCustomFieldValue record.

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Interface/Web.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Interface/Web.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Interface/Web.pm	Wed Jul 11 20:36:56 2007
@@ -1325,20 +1325,22 @@
 
             my %values_hash;
             foreach my $value ( @values ) {
-                # build up a hash of values that the new set has
-                $values_hash{$value} = 1;
-                next if $cf_values->HasEntry( $value );
+                if ( my $entry = $cf_values->HasEntry( $value ) ) {
+                    $values_hash{ $entry->id } = 1;
+                    next;
+                }
 
                 my ( $val, $msg ) = $args{'Object'}->AddCustomFieldValue(
                     Field => $cf,
                     Value => $value
                 );
                 push ( @results, $msg );
+                $values_hash{ $val } = 1 if $val;
             }
 
             $cf_values->RedoSearch;
             while ( my $cf_value = $cf_values->Next ) {
-                next if $values_hash{ $cf_value->Content };
+                next if $values_hash{ $cf_value->id };
 
                 my ( $val, $msg ) = $args{'Object'}->DeleteCustomFieldValue(
                     Field => $cf,


More information about the Rt-commit mailing list