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

ruz at bestpractical.com ruz at bestpractical.com
Wed Oct 25 00:48:16 EDT 2006


Author: ruz
Date: Wed Oct 25 00:48:16 2006
New Revision: 6270

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

Log:
 r4027 at cubic-pc:  cubic | 2006-10-25 08:43:14 +0400
 * drop uninit warnings
 * log warning when queue doesn't exist
 * normalize CF name


Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/Tickets_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/Tickets_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Tickets_Overlay.pm	Wed Oct 25 00:48:16 2006
@@ -1143,12 +1143,11 @@
 =cut
 
 sub _CustomFieldDecipher {
-    my ($self, $field) = @_;
- 
-    my ($queue, $column) = (0, '');
-    if ( $field =~ /^(?:(.+?)\.)?{(.+)}(?:\.(.+))?$/ ) {
-        ($queue, $field, $column) = ($1, $2, $3);
-    }
+    my ($self, $string) = @_;
+
+    my ($queue, $field, $column) =
+        ($string =~ /^(?:(.+?)\.)?{(.+)}(?:\.(.+))?$/);
+    $field ||= ($string =~ /^{(.*?)}$/)[0] || $string;
 
     my $cfid;
     if ( $queue ) {
@@ -1161,10 +1160,16 @@
             $cf = $q->CustomField( $field );
         }
         else {
-            $cf = RT::CustomField->new( $self->CurrentUser );
-            $cf->LoadByNameAndQueue( Queue => 0, Name => $field );
+            $RT::Logger->warning("Queue '$queue' doesn't exists, parsed from '$string'");
+            $queue = 0;
+        }
+
+        if ( $cf and my $id = $cf->id ) {
+            $cfid = $cf->id;
+            $field = $cf->Name;
         }
-        $cfid = $cf->id if $cf;
+    } else {
+        $queue = 0;
     }
  
     return ($queue, $field, $cfid, $column);


More information about the Rt-commit mailing list