Convert Hooks to Object Oriented Implementation

Created on 28 May 2025, about 1 month ago

Problem/Motivation

Update hook implementations to use the Hook attribute and object-oriented implementations for future compatibility and easier maintenance and testing. See https://www.drupal.org/node/3442349 โ†’ .

User interface changes

None

API changes

  • Existing hooks replaced with class loading of new OO implementations
  • Existing hook functions marked with LegacyHook attribute for eventual removal
  • New implementations for hook interactions implemented in hook classes and tagged with Hook attribute

Data model changes

None

๐Ÿ“Œ Task
Status

Active

Version

9.1

Component

Module Core

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States slucero Arkansas

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

Merge Requests

Comments & Activities

  • Issue created by @slucero
  • Pipeline finished with Failed
    about 1 month ago
    Total: 861s
    #508662
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States slucero Arkansas
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia minsharm India

    Did basic regression testing on both D10 and D11, primarily focusing on usage tracking.

    Everything looks good to me.

    Scenarios covered:

    • Adding PatternKit blocks as well as WebRH blocks.
    • Updating and removing blocks.
    • Performing actions from both the new window and within Layout Builder.
    • Adding translations and verifying in the PatternKit usage report.
    • Validating CKEditor5 behavior.
    • Tested with different icons (other than โ€œnoneโ€) from /admin/config/user-interface/patternkit/json.
    • Validated entry for each patternkit block on each page is listed on the admin reports page at /admin/reports/pattern-usage

    Each entry displays the following:

    • The page title
    • A link to the page
    • The name of the used pattern
    • A path to the pattern within the layout
    • The language of the revision containing the pattern entry
    • The node ID of the node layout
    • The revision ID of the node revision

    Also, I have validated the values for each of the entry - Name of the pattern, format of layout path with different section index value, nested pattern, revision id, node id. All the values are accurate.

    • Edit an existing page to add or remove blocks and expect this change to be reflected in the usage report without rescanning via the drush command.
    • Create a new page and set block content on the layout. Expect the new results to be reflected in the usage report without rescanning via the drush command.
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States slucero Arkansas

    Confirmed and ready for merge and inclusion in the 9.1.2 release.

  • Pipeline finished with Skipped
    11 days ago
    #532454
    • slucero โ†’ committed a0b48482 on 9.1.x
      Issue #3527051 by slucero, minsharm: Convert Hooks to Object Oriented...
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States slucero Arkansas

    Merged for inclusion in the 9.1.2 release.

Production build 0.71.5 2024