[Rt-commit] rt branch, 4.0-trunk, updated. rt-4.0.8-349-g507e226

Ruslan Zakirov ruz at bestpractical.com
Thu Jan 10 08:40:36 EST 2013


The branch, 4.0-trunk has been updated
       via  507e226eb60ac1451e0d4bdc81ba75603beba6b4 (commit)
      from  2b86810ad2c9610bbebad7d2e2b2889dacbc5d35 (commit)

Summary of changes:
 lib/RT/Tickets.pm     | 3 +++
 lib/RT/Tickets_SQL.pm | 9 +++------
 2 files changed, 6 insertions(+), 6 deletions(-)

- Log -----------------------------------------------------------------
commit 507e226eb60ac1451e0d4bdc81ba75603beba6b4
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Thu Jan 10 17:37:47 2013 +0400

    make it possible to add a new TicketSQL keyword
    
    It was almost there besides one part where parser
    is case insensetive and hash it checks against is
    not editible from outside.

diff --git a/lib/RT/Tickets.pm b/lib/RT/Tickets.pm
index aad318b..45f7e0c 100644
--- a/lib/RT/Tickets.pm
+++ b/lib/RT/Tickets.pm
@@ -154,6 +154,9 @@ our %FIELD_METADATA = (
     HasNoAttribute     => [ 'HASATTRIBUTE', 0 ],
 );
 
+# Lower Case version of FIELDS, for case insensitivity
+our %LOWER_CASE_FIELDS = map { ( lc($_) => $_ ) } (keys %FIELD_METADATA);
+
 our %SEARCHABLE_SUBFIELDS = (
     User => [qw(
         EmailAddress Name RealName Nickname Organization Address1 Address2
diff --git a/lib/RT/Tickets_SQL.pm b/lib/RT/Tickets_SQL.pm
index ec1bb49..f0b656d 100644
--- a/lib/RT/Tickets_SQL.pm
+++ b/lib/RT/Tickets_SQL.pm
@@ -57,10 +57,7 @@ use RT::SQL;
 # Import configuration data from the lexcial scope of __PACKAGE__ (or
 # at least where those two Subroutines are defined.)
 
-our (%FIELD_METADATA, %dispatch, %can_bundle);
-
-# Lower Case version of FIELDS, for case insensitivity
-my %lcfields = map { ( lc($_) => $_ ) } (keys %FIELD_METADATA);
+our (%FIELD_METADATA, %LOWER_CASE_FIELDS, %dispatch, %can_bundle);
 
 sub _InitSQL {
   my $self = shift;
@@ -193,8 +190,8 @@ sub _parser {
 
         # normalize key and get class (type)
         my $class;
-        if (exists $lcfields{lc $key}) {
-            $key = $lcfields{lc $key};
+        if (exists $LOWER_CASE_FIELDS{lc $key}) {
+            $key = $LOWER_CASE_FIELDS{lc $key};
             $class = $FIELD_METADATA{$key}->[0];
         }
         die "Unknown field '$key' in '$string'" unless $class;

-----------------------------------------------------------------------


More information about the Rt-commit mailing list