Add a ModuleHandler method to invoke hooks and pass args by reference, but without appending _alter

Created on 22 February 2013, over 11 years ago
Updated 14 February 2024, 4 months ago

#1871596: Create a PartialResponse class to encapsulate html-level data [Moving to sandbox] β†’ and some other issues I can't find at the moment point out that we have lots of hooks that aren't suffixed with _alter(), that otherwise are functionally identicatal to an alter hook (they get an argument passed by reference is more or less it).

At the moment the only way to execute those hooks is to loop over the hook implementations and call the hook with $function, which leads to a lot of code repetition and also means you can't easily trace back function calls to the extension manager.

While we might want to revisit why these hooks aren't alters in the first place in many cases, we could also just add a new method to the extension manager that does the same as drupal_alter() without messing around with the hook name.

πŸ“Œ Task
Status

Closed: outdated

Version

9.5

Component
BaseΒ  β†’

Last updated about 3 hours ago

Created by

πŸ‡¬πŸ‡§United Kingdom catch

Live updates comments and jobs are added and updated live.
  • API clean-up

    Refactors an existing API or subsystem for consistency, performance, modularization, flexibility, third-party integration, etc. May imply an API change. Frequently used during the Code Slush phase of the release cycle.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024