Problem/Motivation

Future versions of Drupal will only support object-oriented hook implementations. That update can be done now.

Furthermore, other modules which may need to remove this module's hooks with the #[RemoveHook] attribute (e.g., for performance reasons) aren't able to since that attribute requires a class/method to be specified.

Proposed resolution/Remaining tasks

Convert the following hooks to be object oriented:

  1. hook_entity_presave
  2. hook_entity_presave
    • Convert hook_requirements('runtime') to runtime_requirements hook.: Change record.
    • hook_requirements('install'): Unfortunately, this cannot be converted because it's not possible to call other module-code in the D11+ version of this hook. Change record.

User interface changes

None.

API changes

Requirements will not be checked prior to installation, only at runtime.

Data model changes

None.

Issue fork depcalc-3548151

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

gabesullice created an issue. See original summary.

gabesullice’s picture

Issue summary: View changes
gabesullice’s picture

Assigned: gabesullice » Unassigned
Status: Active » Needs review
gabesullice’s picture

Issue summary: View changes
gabesullice’s picture

In case others are on version 1.22, I've back-ported this MR to that release in this patch because 1.22 does not implement hook_requirements: https://www.drupal.org/files/issues/2025-09-24/3548151-support-object-oriented-hooks.patch

plach’s picture

Status: Needs review » Reviewed & tested by the community

Looks good!