Customizing Limit CustomFields


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 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
and override _CustomFieldLimit there, it does not get picked up.

This is because:

  • The order in which the modules get loaded are:,, , and finally
  • defines a hash of references to limit functions
  • gets makes a COPY of this hash
  • By the time is loaded, already
    has a version of the hash (%dispatch) that points to the version of
    _CustomFieldLimit that exists in

I can get my changes to work properly by making the changes right into, but obviously it will cause difficulties during
migration, and therefore I would prefer to do it cleanly (by overriding
the _CustomFieldLimit function in a … file).

Any suggestions on how I can override _CustomFieldLimit cleanly?



Options for getting RT to do the right thing include:

* Updating the hash that Tickets_Overlay_SQL uses to do dispatch

* Modifying the hash to call by name rather than ref

* Modifying the hash to initialize at runtime. (Be careful of
  the possible performance implications of this)