Context
On September 2020, a new Hook system (Hooks.md ) was released with MediaWiki 1.35. This was done to improve, static validity of hook handler parameters, and enable dependency injection for hook handler classes.
In Dec 2023 Mediawiki 1.42 was released which hard deprecated the old hook system (T335536). Wikibase and a number of our extensions were identified as still using the old method and need be updated before its removal. The date of removal is (as of 2024-12-05) unknown.
Main Objective
Migrate each extensions' hook handlers to use the new MediaWiki interfaces.
- Creating a hook handler class that implements the required hook interface and contains a public method for the hook handler itself, as described in: https://doc.wikimedia.org/mediawiki-core/master/php/md_docs_Hooks.html#autotoc_md47
- Registering the new hook class in extension.json, including any services that need to be injected in the services key (full example)
Relevant Extensions
Owned by Wikidata DOT Team
- T330629 [ES-M5] [EPIC] Migrate EntitySchema Hooks to use MediaWiki hook interfaces and DI
- Blocked by T338452 - T346516 [SW] [LEX] Update WikibaseLexeme to use the new HookContainer/HookRunner system
- Blocked by T338452 - T346519 [WBQC] Update WikibaseQualityConstraints to use the new HookContainer/HookRunner system
Owned by TBD
- T338452 Update Wikibase to use the new HookContainer/HookRunner system
- T346505 Update WikimediaBadges to use the new HookContainer/HookRunner system
Owned by WMF
- T346517 Update WikibaseLexemeCirrusSearch to use the new HookContainer/HookRunner system
- T346518 Update WikibaseCirrusSearch to use the new HookContainer/HookRunner system
- T338456 Update WikibaseMediaInfo to use the new HookContainer/HookRunner system
Considerations
T330629 is the first of this EPICs to be completed, so the learning from this task should be taken into account.