We have a lot of hooks in core/modules/system/system.api.php that do not relate to the System module specifically. See parent issue #2299715: [meta] Move core hooks from system.api.php to core.api.php or other files for more discussion.

For this issue, the task is to move a bunch of module-related hooks to a new file called module.api.php in the same directory.

The file needs to have a @file block at the top with an appropriate description, probably something like:

Hooks related to the module install/uninstall and hook systems.

Then this file should have:

/**
 * @addtogroup hooks
 * @{
 */

The end of the file should also have

/**
 * @} End of "addtogroup hooks".
 */

And then in between the addtogroup blocks, the following hooks should be removed from system.api.php and moved to this new file (probably in this order):

hook_hook_info()
hook_module_implements_alter()
hook_system_info_alter()
hook_module_preinstall()
hook_modules_installed()
hook_install()
hook_module_preuninstall()
hook_modules_uninstalled()
hook_uninstall()
hook_install_tasks()
hook_install_tasks_alter()
hook_update_N()
hook_update_dependencies()
hook_update_last_removed()
hook_updater_info()
hook_updater_info_alter()
hook_requirements()

CommentFileSizeAuthor
#2 2366583-2.patch71.5 KBrpayanm
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhodgdon’s picture

rpayanm’s picture

Status: Active » Needs review
FileSize
71.5 KB
jhodgdon’s picture

Status: Needs review » Fixed

Looks great except for

\ No newline at end of file

So I fixed that with the commit to 8.0.x. Thanks!

  • jhodgdon committed abea965 on 8.0.x
    Issue #2366583 by rpayanm: Move hooks from system.api.php to new module....

Status: Fixed » Closed (fixed)

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