[rt-users] Customizing Limit CustomFields
Kumar, Vasanth
vakumar at blackrock.com
Mon Dec 6 10:15:42 EST 2004
Hi,
We are migrating from RT 3.0.8 to 3.2.2. In 3.0.8, we had some code in
RT::Interface::Web's ProcessSearchQuery method. Our code would take
certain custom fields and massage the data being stored in the custom
field before a search is done. We implemented the changes by creating a
Web_Local.pm and overriding the ProcessSearchQuery method there (in the
section where custom fields are processed).
However, in 3.2.2 during a search, the RT::Tickets' _CustomFieldLimit()
method seems to be used instead to process custom fields. Therefore, I
need to override _CustomFieldLimit, but if I create a Tickets_Local.pm
and override _CustomFieldLimit there, it does not get picked up.
This is because:
- The order in which the modules get loaded are: Tickets.pm,
Tickets_Overlay.pm, Tickets_Overlay_SQL.pm , and finally
Tickets_Local.pm.
- Tickets_Overlay.pm defines a hash of references to limit functions
(%dispatch)
- Tickets_Overlay_SQL.pm gets makes a COPY of this hash
- By the time Tickets_Local.pm is loaded, Tickets_Overlay_SQL.pm already
has a version of the hash (%dispatch) that points to the version of
_CustomFieldLimit that exists in Tickets_Overlay.pm
I can get my changes to work properly by making the changes right into
Tickets_Overlay.pm, but obviously it will cause difficulties during
migration, and therefore I would prefer to do it cleanly (by overriding
the _CustomFieldLimit function in a ..Local.pm file).
Any suggestions on how I can override _CustomFieldLimit cleanly?
Thanks.
Vasanth
More information about the rt-users
mailing list