[Rt-devel] RT 3.4.2 Bug & Patch - Incorrect Custom Field Values in Search Results

Stephen Turner sturner at MIT.EDU
Wed Feb 15 11:41:00 EST 2006


At Tuesday 2/14/2006 05:12 PM, Jesse Vincent wrote:

>On Tue, Feb 14, 2006 at 05:10:35PM -0500, Stephen Turner wrote:
> >
> > Ah - how about doing this only if the field argument is supplied?
>
>If it's supplied and comes up empty. That seems reasonable.
> >
> > Thanks,
> > Steve
> >

Here is a revised patch - I've explicitly handled the 'null field arg' 
condition up front, as there's no need to go through the LoadByNameAndQueue 
stuff in that case.

Steve

--- Ticket_Overlay.pm.orig      2006-02-14 16:50:04.000000000 -0500
+++ Ticket_Overlay.pm   2006-02-15 11:31:06.000000000 -0500
@@ -3652,11 +3652,16 @@
  sub CustomFieldValues {
      my $self  = shift;
      my $field = shift;
+
+    return $self->SUPER::CustomFieldValues() unless $field;
+
      unless ( $field =~ /^\d+$/ ) {
          my $cf = RT::CustomField->new( $self->CurrentUser );
          $cf->LoadByNameAndQueue( Name => $field, Queue => 
$self->QueueObj->Id );
          unless ( $cf->id ) {
              $cf->LoadByNameAndQueue( Name => $field, Queue => '0' );
+           return RT::ObjectCustomFieldValues->new( $self->CurrentUser )
+               unless $cf->id;
          }
          $field = $cf->id;
      }



More information about the Rt-devel mailing list