[Rt-commit] r13111 - rt/branches/3.8-TESTING/lib/RT

ruz at bestpractical.com ruz at bestpractical.com
Tue Jun 10 10:29:13 EDT 2008


Author: ruz
Date: Tue Jun 10 10:29:07 2008
New Revision: 13111

Modified:
   rt/branches/3.8-TESTING/lib/RT/Tickets_Overlay.pm

Log:
* don't count as we need results
* don't return object if there are multiple fields
  with the same name

Modified: rt/branches/3.8-TESTING/lib/RT/Tickets_Overlay.pm
==============================================================================
--- rt/branches/3.8-TESTING/lib/RT/Tickets_Overlay.pm	(original)
+++ rt/branches/3.8-TESTING/lib/RT/Tickets_Overlay.pm	Tue Jun 10 10:29:07 2008
@@ -1137,21 +1137,23 @@
             $RT::Logger->warning("Queue '$queue' doesn't exist, parsed from '$string'");
             $queue = 0;
         }
-    } 
-    if (!$queue) {
+    }
+    else {
         $queue = '';
         my $cfs = RT::CustomFields->new( $self->CurrentUser );
         $cfs->Limit( FIELD => 'Name', VALUE => $field );
         $cfs->LimitToLookupType('RT::Queue-RT::Ticket');
-        my $count = $cfs->Count;
 
-        if ($count >= 1) { $cf = $cfs->First}
-        elsif ($count == 0 ) { $cf = undef }
+        # if there is more then one field the current user can
+        # see with the same name then we shouldn't return cf object
+        # as we don't know which one to use
+        $cf = $cfs->First;
+        if ( $cf ) {
+            $cf = undef if $cfs->Next;
+        }
     }
 
-
     return ($queue, $field, $cf, $column);
-
 }
 
 =head2 _CustomFieldJoin


More information about the Rt-commit mailing list