Heads up: Dashboard mailing can break if you have a callback using Mason's $r->uri

Hi all,

Just a quick heads up in case it helps others in the future: we’ve been setting up a mailed out Dashboard on one of our RT instances and finding the resulting HTML mail all screwed up with an exception stack trace in the middle of it. I tracked it down to a pre-existing callback that we have in place that starts off by getting the URI of the request from Mason using the $r->uri. That works fine in the Web UI with the real Mason stuff running. The Dashboarder mailer fakes a Mason request object but doesn’t implement the uri() method on it.

A simple fix is just to add a uri() subroutine to the Dashboard::FakeRequest package at the end of lib/RT/Dashboard/Mailer.pm that just returns an empty string (as there is no URI). URI pattern matches in the callback then run OK (and don’t match so don’t do anything in our case which is good) and we get a sensible HTML email output.

I’ve reported it to Best Practical along with a context diff patch for RT 5.0.1 (ticket id=37331).