Problem/Motivation

ModuleInstaller currently loops over every module and calls invoke for each hook, so this tries invoking hooks on modules that have not implemented them.
This in turn calls legacyInvoke which is not performant.

It is better to call invokeAll and let ModuleHandler do the work. This is more performant and more future proof.

Steps to reproduce

N/A

Proposed resolution

Change from a foreach loop to modulehander invokeall

Remaining tasks

N/A

User interface changes

N/A

Introduced terminology

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

Issue fork drupal-3486995

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

nicxvan created an issue. See original summary.

nicxvan’s picture

Issue summary: View changes

Credit

nicxvan’s picture

nicxvan’s picture

Status: Active » Needs review
nicxvan’s picture

Issue summary: View changes
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

Seems like a straight forward

  • larowlan committed 42402ecb on 11.1.x
    Issue #3486995 by nicxvan: Clean up how ModuleInstaller invokes hooks...

  • larowlan committed eab46c49 on 11.x
    Issue #3486995 by nicxvan: Clean up how ModuleInstaller invokes hooks...
larowlan’s picture

Version: 11.x-dev » 11.1.x-dev
Status: Reviewed & tested by the community » Fixed

committed to 11.x and backported to 11.1.x - thanks!

Status: Fixed » Closed (fixed)

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