-
Alex Vandiver authored
rt-crontool has cached lookup of the the name of the template ever since 3.8, when the ability to specify a template by name was introduced. The template object is modified in memory when ->Parse is called, however, updating its ->MIMEObj. This was not a problem because RT::Action::SendEmail->Prepare calls ->Parse, which clears out its ->MIMEObj. Unfortunately, a1a4f73e caused Template objects which already had a MIMEObj to retain them. In the context of rt-crontool, this causes the same content (that formed from the first matching ticket) to be sent out on all tickets whenever RT::Action::SendEmail is used as the target action. RT::Action::RecordCorrespondence is unaffected, however, as it always calls ->Parse. Remove the unnecessary cache in rt-conjob; looking up a Template objects per RT::Ticket result is unlikely to result in performance implications, as it is a small and well-indexed table, and caching repeatedly proves to be complicated to implement without unexpected side-effects. Fixes I#29454.
b6efaa8e