[Rt-devel] Problem redefining hashes in Tickets_Local.pm

Michael Gilbert mdgilb at u.washington.edu
Fri Mar 3 18:21:21 EST 2006


Yes, I am setting the package name in Tickets_Local.  I should mention 
that all previous changes have worked fine in Tickets_Local and all the 
other _Locals, but all those changes were to existing  or new 
subroutines, not hash definitions. 

For example, the &_TagLimit routine mentioned below is read without any 
problems, and it only exists in the _Local, not the _Overlay.  It's only 
the hash definitions that I can't seem to add to.

Thanks,
Michael

Todd Chapman wrote:
> On Fri, Mar 03, 2006 at 01:12:14PM -0800, Michael Gilbert wrote:
>   
>> Hello,
>> I'm having what is likely a simple problem, but I haven't been able to 
>> come up with the answer on my own yet and was hoping for some advice.
>>
>> What I'm trying to do is add keys to the %FIELDS and %dispatch hashes in 
>> Tickets_Local in order to handle searches on a custom Tags table, 
>> however the new keys are never properly added to the hashes.  I've 
>> attempted including them directly in the hash declarations:
>> %Fields =
>> ...
>>    Tag              => [ 'TAG', ],
>>    Tags             => [ 'TAG', ],
>> %dispatch =
>> ...
>>    TAG             => \&_TagLimit,
>>
>> As well as adding them in after the fact:
>> $FIELDS{'Tag'}  = ['TAG'];
>> $FIELDS{'Tags'} = ['TAG'];
>> $dispatch{'TAG'} = \&_TagLimit;
>>
>> Neither of which seems to have any affect on the hashes at runtime.  
>> Both of the above work properly, however, when I add them directly into 
>> Tickets_Overly.pm
>>
>> My question is if anyone knows of a way to update these hashes without 
>> modifying Tickets_Overlay (keep the update in Tickets_Local).  I would 
>> guess this is a problem of scope, but I haven't yet been able to find a 
>> way around it (including completely commenting out the FIELDS and 
>> dispatch declarations in Tickets_Overlay).
>>
>>     
>
> In your _Local file are you setting the package name?
>
> package RT::Tickets;
>
>
>
> -Todd
>   



More information about the Rt-devel mailing list