XF 2.2 Running code after Add-on has changed active state

Kirby

Well-known member
I might be missing smth. but short of extending XF\AddOn\AddOnManger I don't see a clean way to run code after the active state of any Add-on has changed.

XF\Addon\AddOn\AddOn does have code events for install/uninstall/upgrade/rebuild, but not for active state change.

Any ideas?
 
Last edited:
Populate the onActiveChange method in the add-on setup class:

Code:
public function onActiveChange($newActive, array &$jobList)
{
}
 
You didn't really specify that.

For something that applies to all add-ons, I'd have thought that just extending the add-on entity would be appropriate otherwise, yes, you'd have to find another way.
 
Yeah, I accidently missed th y for any when submitting the initial post :)

Thanks for clarifying that an extension is the only way (at the moment), still feels a bit strange though as there are code events for other Add-on related changes (install, etc.) but not for active state change.
 
Top Bottom