Ordering of alter "extra hooks" is a gigantic mess

Created on 30 October 2024, about 2 months ago

Problem/Motivation

  1. In πŸ“Œ OOP hooks using attributes and event dispatcher Needs review a new mechanism was added to order hook implementations: service providers can change the priority
    of event listeners and a HookOrder helper class is provided to make the common operations (first/last/before/after) easy. This mechanism is working as intended.
  2. Also, hook_module_implements_alter is called during build time for procedural hooks for backwards compatibility reasons. This mechanism is also working as intended however it is scheduled for removal once procedural hooks are no longer supported.
  3. ModuleHandler::reOrderModulesForAlter calls hook_module_implements_alter with the module names of OOP hook implementations. This is not at all intended, this should be using #1 somehow.

    Steps to reproduce

    Try to order a hook implementing form_BASE_FORM_ID_alter relative to a hook implementing form_FORM_ID_alter using #1. This utterly doesn't work. Observe however #2 does .

    Proposed resolution

    Β―\_(ツ)_/Β―

    Changing the HookOrder methods to accommodate a list of hooks is easy. Changing ModuleHandler::reOrderModulesForAlter is the second step but to what?

    Remaining tasks

    Get someone to figure this out. I am getting a headache.

    User interface changes

    Introduced terminology

    API changes

    Data model changes

    Release notes snippet

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component

base system

Created by

πŸ‡¨πŸ‡¦Canada Charlie ChX Negyesi 🍁Canada

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024