Problem/Motivation

Implement OOP hooks for better OOP & DI support, instead of having all hook logic in the module file.

Proposed resolution

Convert hook implementations to OOP hooks, with backwards compatibility.
See https://www.drupal.org/node/3442349

Remaining tasks

- Define hooks that can be converted into OOP hooks
- Create hook clas(ses) to logically bundle relevant hooks with their logic
- Add backwards compatibility support

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Issue fork queue_ui-3519846

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

svendecabooter created an issue. See original summary.

robbesaelens made their first commit to this issue’s fork.

robbesaelens changed the visibility of the branch 3519846-support-oop-hooks to hidden.

robbesaelens changed the visibility of the branch 3519846-support-oop-hooks to active.

robbesaelens’s picture

Status: Active » Needs review
voleger’s picture

Version: 3.2.x-dev » 4.0.x-dev

This change will increase the minimum requirement to at least `drupal/core:^11.2.0`.
That's why we can't add this in the next patch version of 3.2.x.

svendecabooter’s picture

It is made backwards compatible from Drupal 10.1 on, with the #[LegacyHook] attribute.
See https://www.drupal.org/node/3442349#hook_convert
That's already added in this MR - so could still go into 3.2.x if desired.

voleger’s picture

Version: 4.0.x-dev » 3.2.x-dev
Status: Needs review » Reviewed & tested by the community

Makes sense. Let's remove legacy hook implementation for 4.0.x in followup issue,

voleger’s picture

Status: Reviewed & tested by the community » Fixed

Merged, thanks

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.