[rt-users] Custom Field appears twice

Todd Chapman todd at chaka.net
Mon Mar 14 16:22:25 EST 2005


On Mon, Mar 14, 2005 at 04:03:56PM -0500, Mathew Walker wrote:
> I created a simple Custom field called "Product".
> 
> I see it on the Custom Fields main configuration page looking good.  I go 
> to my General queue's Ticket Custom Fields and see:
> 
> Global Custom Fields:
>     - Product
> 
> Selected Custom Fields:
>  <x> Product
> 
> Unselected Custom Fields:
> -
> 
> When I open a new ticket or look at a ticket, it displays the field twice 
> somehow.  Not sure where it's coming from.  I've skimmed the other files 
> but can't see anything obvious.

There is a bug where if a CF is set to be global and also
set specifically on a queue it will appear twice.

See: http://rt3.fsck.com/Ticket/Display.html?id=6365
(username=guest password=guest)

I just happened to be reading the code right now to see how to fix it.

THe problem is that RT::Record::CustomFields has this code:

sub CustomFields {
    my $self = shift;
    my $cfs = RT::CustomFields->new( $self->CurrentUser );
    $cfs->UnLimit;

    # XXX handle multiple types properly
        $cfs->LimitToLookupType($self->CustomFieldLookupType);
        $cfs->LimitToGlobalOrObjectId($self->_LookupId($self->CustomFieldLookupType));

    return $cfs;
}


This result in 2 rows being returned from the DB, one for the global
designation and one for the queue specific.

I am trying to figure out if this sub needs to be changed (probably)
or if the mason components need to remember which CFs they have
displayed and skip them the 2nd time.

-Todd



More information about the rt-users mailing list