1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Add-on not working after XF upgrades, has to be reinstalled

Discussion in 'XenForo Development Discussions' started by karll, Jul 8, 2013.

  1. karll

    karll Well-Known Member

    Except for my lack of talent, what could be the reason I need to reinstall my add-on after every XF upgrade?
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Which add-on?
    What about it no longer works after upgrading each time?
     
  3. karll

    karll Well-Known Member

    This one. It's supposed to modify a drop-down menu (the one on this page), but it doesn't do that after XF upgrades. (It happened with 1.1.5 and 1.2 RC4, which are the only ones I've tested, I think.)
     
  4. Chris D

    Chris D XenForo Developer Staff Member

    Your watch_threads_all template is being overwritten during upgrades which is exactly the expected behavior. To modify core templates, you don't just overwrite them in your add-on.

    You're supposed to use template hooks or similar to inject your changes into the existing template.
     
    Jeremy, karll and Brogan like this.
  5. karll

    karll Well-Known Member

    Thanks muchly for this. However, there doesn't appear to be any hooks in the watch_threads_all template ... What can I do then?
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    karll likes this.
  7. karll

    karll Well-Known Member

  8. Chris D

    Chris D XenForo Developer Staff Member

    Yeah, the TM system is much more appropriate now.

    Aside from that, though, you can also try the template_post_render event which allows you to modify the rendered template directly in PHP. Very similar to template hooks.

    But it's great that we don't have to use those anymore :)
     

Share This Page