Fix invocation of hook_module(s)_(pre(un))install(ed) so they support OOP hooks

Created on 9 November 2024, about 1 month ago

Problem/Motivation

  • hook_module_preuninstall
  • hook_module_preinstall
  • hook_modules_installed
  • hook_modules_uninstalled

Are all invoked using invokeAll during module install.
Since these are all acting on already installed modules we should be able to replace ModuleInstaller->invokeAll() with ModuleHandler->invokeAll() similar to πŸ› Add hook_cache_flush to procedural only Active
Since these are all closely related we should convert them in the same issue.

Steps to reproduce

Convert a hook
Install a module
Uninstall a module
See hooks did not run

Proposed resolution

  1. Invoke moduleHandler->invokeAll instead of module installer's invoke
  2. Remove hook_cache_flush from procedural only list

Remaining tasks

Update the original OOP hook CR to remove it from the list of unsupported hooks.
https://www.drupal.org/node/3442349 β†’
Add CR with this too

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component

base system

Created by

πŸ‡ΊπŸ‡ΈUnited States nicxvan

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