Page MenuHomePhabricator

Let other extensions register new actions via hooks, not config
Closed, ResolvedPublic

Description

Hooks seem more suitable for this use case, because 1) it's easier to allow complicated stuff, 2) sysadmins aren't meant to use this config option.

On gerrit there's an attempt from 2015. It's probably easier to start again from scratch, but the implementation can be copied.

Event Timeline

Since the consequences system is being refactored, it's probably a good idea to write this hook afterwards. This hook might be used as a single place to register both the extension name (currently done via $wgAbuseFilterActions) and the "callback" using the new system (e.g. by returning a value object extending Consequence as per r633380).

Change 644074 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] [WIP] Add a hook for extensions to add custom actions

https://gerrit.wikimedia.org/r/644074

Change 644074 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] Add a hook for extensions to add custom actions

https://gerrit.wikimedia.org/r/644074

This was implemented last month. The config is deprecated and will be removed in 1.37.