HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

[V2.0.18.8] Possible bug - "OnDisable" is not called for Applications

I'm developing an application built on Garden/Vanilla 2.0.18.8 and I noticed that, when it's disabled, the OnDisable hook is not invoked. I tried putting a brutal die() statement in it, logging its execution, printing a message, but it really seems that it's skipped.

I looked through the core files and, while I could see a call for ThemeHooks::OnDisable and Plugin::OnDisable(), I could not find a call to Application::OnDisable().

The severity of such bug depends on the application itself. The one I'm working on, for example, creates some routes that would fail if the application is disabled and, therefore, should be removed in the OnDisable handler. If an application doesn't actually need to do anything in that phase, then there would be no impact.

Comments

  • why don't you mention this on github?

    grep is your friend.

  • The only reference to this being 'a thing' in 2.0.18.8 is in the Skeleton application hooks file. None of the actual applications (dashboard, vanilla, and conversations) have it declared. This may be the case of copying the plugin skeleton comments over to the application hooks file and not switching everything over to an application context.

    Either way, this functionality does not exist in 2.1b2 either. There is a workaround available for 2.2+ since you could hook into the ApplicationManager_AddonDisabled_Handler event with a separate plugin.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • @x00 said:
    why don't you mention this on github?

    Because I didn't think about it. I'll do it now. :)

Sign In or Register to comment.