Move hook out of .module file

Created on 23 June 2025, 21 days ago

Problem/Motivation

I wrote this quickly to demonstrate the concept in a traditional hook function in the .module file but things move on, as they do, and we can now do hooks in classes.

Steps to reproduce

n/a

Proposed resolution

Create a class file that implements the hook according to https://www.drupal.org/node/3442349 → and then remove the .module completely.
We definitely want to support Drupal 10.1 upwards so include the shim at "Backwards-compatible Hook implementation for Drupal versions from 10.1 to 11.0"

Remaining tasks

Create the CR

User interface changes

none

API changes

none

Data model changes

none

šŸ“Œ Task
Status

Active

Version

1.0

Component

Code

Created by

šŸ‡¬šŸ‡§United Kingdom rachel_norfolk UK

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