Fixed Error from legacy add-on alerts

Jake B.

Well-known member
Affected version
2.0.X
After upgrading to XF2 there are several errors generated from alerts coming from legacy XF1 add-ons that have been uninstalled after upgrading to xf2, for example:

ErrorException: Template error: Template public:alert_post_cmf_reply is unknown src/XF/Template/Templater.php:583
 
Yeah, on 2.0.7, the latest :)

Though, that one was just about rendering empty alerts, this time around it seems to actually be breaking the alert page
 
It's basically the same thing, though the circumstances are different. My guess is, based on the template name, that this is a custom alert but using a default content type. In that case, checking for the handler isn't going to work because obviously the post content type and the post alert handler will be available.

So I've added a bit of a sanity check, which actually runs in the controller (rather than the template) which involves filtering based on a new method called isAlertRenderable this ensures there's a handler (as we do now in the template) but also checks to see if the template actually exists. If it doesn't, we remove it from the list, and therefore no error when we try to render.
 
Back
Top Bottom