Implement object oriented hooks

Created on 20 October 2024, 8 months ago

Problem/Motivation

See Change Record β†’ for details.

πŸ“Œ Task
Status

Active

Version

2.1

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

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

Comments & Activities

  • Issue created by @jurgenhaas
  • πŸ‡ΊπŸ‡ΈUnited States michaellander

    Worth noting, we found an issue with eca_config_schema_info_alter() not firing when the eca_config module was enabled. I was able to work around this by using an OOP hook.

    See πŸ“Œ Config validation for ECA models Active

  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    Thanks @michaellander for the additional info. I think, though, that we will not switch to OOP hooks with ECA 2.1 because that version also supports Drupal 10.3 and then things would be broken. We will wait for ECA 3.x which will eventually support ^11.4 || ^12 of Drupal core. Note: 11.4 as the lowest version I've just made up, it's not clear yet which 11 release will be the one that won't see too many breaking changes before Drupal 12.

  • First commit to issue fork.
  • πŸ‡ΊπŸ‡ΈUnited States danielataniguchi Houston Texas

    I've worked on implementing object oriented hooks and the Backwards-compatible Hook implementation for Drupal versions from 10.1 to 11.0 according to https://www.drupal.org/node/3442349 β†’

  • πŸ‡©πŸ‡ͺGermany mxh Offenburg

    Some thoughts:

    • When implementing this on one of the next major versions that require at least Drupal 11 then I guess we don't need to consider LegacyHook or any other sort of BC layer. Just going all-in for OOP hooks.
    • I didn't look any more in detail, but one thing I noted was that hooks are being registered as listeners into the event_dispatcher service - something ECA does as well. Is it maybe possible that we merge some of our hook-related events entirely to OOP hooks, so we could reduce some class definition overhead?
Production build 0.71.5 2024