[Rt-commit] r4651 - in rt/branches/3.7-EXPERIMENTAL: .

ruz at bestpractical.com ruz at bestpractical.com
Thu Mar 2 11:49:53 EST 2006


Author: ruz
Date: Thu Mar  2 11:49:52 2006
New Revision: 4651

Modified:
   rt/branches/3.7-EXPERIMENTAL/   (props changed)
   rt/branches/3.7-EXPERIMENTAL/lib/RT/CustomFieldValues/External.pm

Log:
 r1992 at cubic-pc:  cubic | 2006-03-02 12:43:57 +0300
  r1991 at cubic-pc:  cubic | 2006-03-02 12:43:27 +0300
  * drop check if there is no conditions
 


Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/CustomFieldValues/External.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/CustomFieldValues/External.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/CustomFieldValues/External.pm	Thu Mar  2 11:49:52 2006
@@ -79,14 +79,16 @@
 sub __BuildAggregatorsCheck {
     my $self = shift;
 
-    my %h = ( OR => '||', AND => '&&' );
+    my %h = ( OR => ' || ', AND => ' && ' );
     
     my $code = '';
     for( my $i = 0; $i < @{ $self->{'__external_cf_limits'} }; $i++ ) {
         next unless $self->{'__external_cf_limits'}->[$i]->{'CALLBACK'};
-        $code .= ' '. $h{ uc($self->{'__external_cf_limits'}->[$i]->{'ENTRYAGGREGATOR'} || 'OR') } .' ' if $code;
+        $code .= $h{ uc($self->{'__external_cf_limits'}->[$i]->{'ENTRYAGGREGATOR'} || 'OR') } if $code;
         $code .= '$sb->{\'__external_cf_limits\'}->['. $i .']->{\'CALLBACK\'}->($record)';
     }
+    return unless $code;
+
     $code = "sub { my (\$sb,\$record) = (\@_); return $code }";
     my $cb = eval "$code";
     $RT::Logger->error( "Couldn't build callback '$code': $@" ) if $@;
@@ -116,7 +118,7 @@
     foreach( @{ $self->ExternalValues } ) {
         my $value = $self->NewItem;
         $value->LoadFromHash( { %defaults, %$_ } );
-        next unless $check->( $self, $value );
+        next if $check && !$check->( $self, $value );
         $self->AddRecord( $value );
     }
     $self->{'must_redo_search'} = 0;


More information about the Rt-commit mailing list