Problem/Motivation

It's seems odd that hook_system_info_alter has the word "system" in it. It should really have the word "extension" instead. Furthermore, it makes it sound like the hook is provided by the system module, but it is not.

Steps to reproduce

Proposed resolution

Introduce hook_extension_info_alter and deprecate hook_system_info_alter.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3623862

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

mstrelan created an issue. See original summary.

nicxvan’s picture

Makes sense to me!

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

mstrelan’s picture

Status: Active » Needs review

mstrelan changed the visibility of the branch 3623862-rename-hooksysteminfoalter-to to hidden.

daffie’s picture

Just a question: Should we create a BC layer instead of just removing the old hook_system_info_alter? The current MR just removes the old hook.

mstrelan’s picture

It doesn't just remove the old hook, it invokes it with $this->moduleHandler->alterDeprecated()

daffie’s picture

Status: Needs review » Reviewed & tested by the community

All code changes look good to me.
The new hook has replaced the old hook.
The old is still called as deprecated.
For me it is RTBC.

nicxvan’s picture

I tweaked the CR.

I always wonder in these cases, which do we call first? The new hook or the old one?
Is there a way to detect that something changed in the new hook and only call the legacy if nothing changes?

mstrelan’s picture

I can't imagine it matters too much here. If it does, implementors could always guard against it with a class property or even a conditional on the values in the info that has been altered.

nicxvan’s picture

Fair enough, can we add a note to that effect to the CR?

catch’s picture

On the issue summary, this is because system module used to do all this, we only fully removed system_rebuild_module_data() in 2020.