Allow to use RemoveHook attribute with just a module instead of class and method

Created on 7 August 2025, 6 days ago

Problem/Motivation

To remove a hook with the RemoveHook attribute, you must specify a class and method.

This forces you to hardcode things that we consider internals. We are moving around hook methods between classes in core in minor versions, so we clearly consider this very much an internal thing.

Hook implementations are not covered by BC, but at the same time, we also offer an explicit API to do removals and there are valid cases for this even in core.

Steps to reproduce

Proposed resolution

Add a module argument to RemoveHook, require either module or class + method. There are edge cases where you might want to remove just one out of multiple hook implementations, but that's going to be extremely rare.

The current approach also makes BC hard if you want to remove a hook from another module that hasn't yet converted to OOP but eventually will.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

📌 Task
Status

Active

Version

11.0 🔥

Component

extension system

Created by

🇨🇭Switzerland berdir Switzerland

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024