XF 2.2 XenForo 2.2.8 undocumented backwards compatibility break for REST API

Jake B.

Well-known member
XenForo 2.2.8 adds a new empty \XF\Api\Templater class, which directly extends the base \XF\Template\Templater class. If you have any class extensions on \XF\Template\Templater that you expect to apply within the REST API you'll have to duplicate them, or split out your custom parts into a trait that gets included on both and call that trait's function from within your extended methods.
 
Good catch, and definitely worth mentioning. Another approach might be to use the templater_setup event, which will hook all of the various templaters (Base, API, Install, Mail) and will probably be more resilient to changes like this.
 
Back
Top Bottom