[rt-users] Problems with disabled custom fields

Jesse Vincent jesse at bestpractical.com
Fri May 6 16:09:43 EDT 2005


> 
> Second problem, the disabled custom field still shows as active when  
> I view the queue that used it, and I am unable to remove it from the  
> queue (deselect the check box, submit, and the page refreshes with  
> the field still listed, and the checkbox re-checked).
> 
=== ObjectCustomFields_Overlay.pm
==================================================================
--- ObjectCustomFields_Overlay.pm  (revision 15828)
+++ ObjectCustomFields_Overlay.pm  (revision 15829)
@@ -63,12 +63,14 @@
 sub LimitToLookupType {
     my $self = shift;
     my $lookup = shift;
-    my $cfs = $self->NewAlias('CustomFields');
+    unless ($self->{'_cfs_alias'}) {
+        $self->{'_cfs_alias'}  = $self->NewAlias('CustomFields');
+    }
     $self->Join( ALIAS1 => 'main',
                 FIELD1 => 'CustomField',
-                ALIAS2 => $cfs,
+                ALIAS2 => $self->{'_cfs_alias'},
                 FIELD2 => 'id' );
-    $self->Limit( ALIAS           => $cfs,
+    $self->Limit( ALIAS           => $self->{'_cfs_alias'},
                  FIELD           => 'LookupType',
                  OPERATOR        => '=',
                  VALUE           => $lookup );
@@ -97,4 +99,15 @@
     map { $_->CustomFieldObj } @{$self->ItemsArrayRef};
 }
 
+sub _DoSearch {
+    my $self = shift;
+    if ($self->{'_cfs_alias'}) {
+    $self->Limit( ALIAS           => $self->{'_cfs_alias'},
+                 FIELD           => 'Disabled',
+                 OPERATOR        => '!=',
+                 VALUE           =>  1);
+    }
+    $self->SUPER::_DoSearch()
+}
+
 1;
>    Matt Pounsett



> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> 
> Be sure to check out the RT Wiki at http://wiki.bestpractical.com

-- 



More information about the rt-users mailing list