[rt-users] Footer callback not working in Bulk.html and Resutls.html + patch solution

Eynat Nir Mishor eynatnir2 at hotmail.com
Tue Jan 8 01:49:00 EST 2008

I've created a Footer callback
(html/Callbacks/MyName/Elements/Footer/Default) in order to add my own text
to the end of every page.

I found that the Footer callback wasn't called in Bulk.html and Results.html
(both have links to them from the search results page as "Update multiple
tickets" and "Bookmarkable link" respectively).


It seems that the problem is due to over-use of the argument name "$Page" in
RT components.

The callback mechanism is coded in html/Elements/Callback.

This component takes a "$Page" argument as the path of the component that
triggered the callback.  If it doesn't receive the argument (and it never
does in the standard shipped RT), it computes it from the callstack.

As luck has it, html/Search/Bulk.html and Results.html have a "$Page"
argument as well for a totally different purpose (page number of search
result in case of many entries).  It has a default value of 1.  Therefore,
this argument is passed on to the Footer and to Callback and RT tries to
look for a callback of a component called "1" instead of "Elements/Footer".


To fix this, I renamed the argument in  html/Elements/Callback to be called
"$PageForCallback" (no need to change anything else since no code ever
passes it a value, yet).

I actually did the change in a "local" version of html/Elements/Callback.

It would be great if this fix would enter the RT code base.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20080108/f748b14f/attachment.htm>

More information about the rt-users mailing list