[Rt-commit] r8046 - rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Interface/Web/QueryBuilder

ruz at bestpractical.com ruz at bestpractical.com
Sat Jun 30 22:29:06 EDT 2007


Author: ruz
Date: Sat Jun 30 22:29:06 2007
New Revision: 8046

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

Log:
* check in the FIELDS only first part of a key (up to first dot).
  Not the whole key as it can be 'CF.{foo}' and sure there is no
  something like that in the FIELDS hash.


Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Interface/Web/QueryBuilder/Tree.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Interface/Web/QueryBuilder/Tree.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Interface/Web/QueryBuilder/Tree.pm	Sat Jun 30 22:29:06 2007
@@ -254,10 +254,12 @@
     $callback{'Condition'} = sub {
         my ($key, $op, $value) = @_;
 
+        my ($main_key) = split /[.]/, $key;
+
         my $class;
-        if ( exists $lcfield{ lc $key } ) {
-            $key   = $lcfield{ lc $key };
-            $class = $field{$key}->[0];
+        if ( exists $lcfield{ lc $main_key } ) {
+            $class = $field{ $main_key }->[0];
+            $key =~ s/^[^.]+/ $lcfield{ lc $main_key } /e;
         }
         unless( $class ) {
             push @results, [ $args{'CurrentUser'}->loc("Unknown field: $key"), -1 ]


More information about the Rt-commit mailing list