By kristiaanvandeneynde on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
2.0.x
Introduced in version:
2.0.0
Description:
Anything you want to run when a plugin gets installed on a group type should do so using this handler.
The reason is simple: If you run your code in an entity hook, event listener or whatever, then it's hard for others to step in and change what you're doing. With the new handler system using decorators, it's actually better to specify post_install "tasks" (aka callables) so that the fully built list only gets called at the end, leaving ample opportunity to add to or remove from the list.
Have a look at src/Plugin/Group/RelationHandler/GroupMembershipPostInstall.php for an example.
Impacts:
Module developers
Site templates, recipes and distribution developers