Page MenuHomePhabricator

[EPIC] Update extensions that run hooks to use the new HookContainer/HookRunner system
Open, Needs TriagePublic

Description

Only available for extensions that already require MW 1.35+
See subtasks for individual extensions


Implement the Hook system added in MediaWiki 1.35 in the extensions, see Hooks.md for documentation.

Related Objects

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

https://lists.wikimedia.org/pipermail/wikitech-l/2020-May/093450.html

Using the new system in extensions
----------------------------------

Extensions should create their own HookRunner classes and use them to
call hooks. HookContainer::run() should be used instead of Hooks::run().

As for handling hooks, I think it's too early for a mass migration of
extensions to the new registration system as described in the RFC.[3]
Extension authors who are keen to pilot the new system can give it a
go. Make sure you add Nikki and me as reviewers.

More information about the new system can be found in docs/Hooks.md
[4]. The patch to add it should soon be merged.

https://lists.wikimedia.org/pipermail/wikitech-l/2020-May/093450.html

Using the new system in extensions
----------------------------------

Extensions should create their own HookRunner classes and use them to
call hooks. HookContainer::run() should be used instead of Hooks::run().

As for handling hooks, I think it's too early for a mass migration of
extensions to the new registration system as described in the RFC.[3]
Extension authors who are keen to pilot the new system can give it a
go. Make sure you add Nikki and me as reviewers.

More information about the new system can be found in docs/Hooks.md
[4]. The patch to add it should soon be merged.

I understood that to be referring to the registration of extension's hook handlers, not the method by which extensions themselves call hooks

[1] https://gerrit.wikimedia.org/r/c/mediawiki/core/+/571297
[2] https://gerrit.wikimedia.org/r/c/mediawiki/core/+/581225
[3] https://phabricator.wikimedia.org/T240307 (currently marked as "resolved" even if it still depends on T250859 "Rename BeforeParserrenderImageGalleryHook to BeforeParserRenderImageGalleryHook" and T253768 "No easy way to suppress hard-deprecation warnings for hooks", both still open)
[4] https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/323ac073d38ec30a97b73b4a25999079b3a125d3/docs/Hooks.md>