Problem/Motivation

The documentation for hook_modules_installed has changed since the original report and it should be in the .module file.

Steps to reproduce

Proposed resolution

The only file in core with one of these hooks. router_installer_test_modules_installed, in .install in a test file, router_installer_test.install.
Since that hook is the only code in the file, rename the file to router_installer_test.module

Remaining tasks

Review
Commit

CommentFileSizeAuthor
#10 1306624-10.patch401 bytesquietone

Comments

pingers’s picture

A fair point... why does comment module contain the only implementation in {module}.install?

#890128: Comment body missing if comment module enabled after a content type module is where the commit came from (for comment.install).
d12eba1705dfa3c6f7da93f81c403b33de8fd8fc

The hook implementation runs regardless of whether it's in .module or .install when enabling a module. Consistency would be good though.
Probably doesn't need to be in .module.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

quietone’s picture

Version: 8.9.x-dev » 9.3.x-dev
Issue summary: View changes
Status: Active » Needs review
Issue tags: +Bug Smash Initiative
StatusFileSize
new401 bytes

hook_modules_enabled and hook_modules_disabled were removed in #1199946: Disabled modules are broken beyond repair so the "disable" functionality needs to be removed. Some grepping shows that all the modules_installed and modules_uninstalled are all in .module files except for a test module core/modules/system/tests/modules/router_installer_test/router_installer_test.install.

vicki@dev1-web:/var/www/html$ grep -ri _modules_installed core/modules/| grep -v Test | awk -F: '{print $1}' | sort -u
core/modules/block/block.module
core/modules/help_topics/help_topics.module
core/modules/jsonapi/jsonapi.module
core/modules/language/language.module
core/modules/locale/locale.module
core/modules/node/node.module
core/modules/system/tests/modules/module_test/module_test.module
core/modules/system/tests/modules/router_installer_test/router_installer_test.install
core/modules/system/tests/modules/system_test/system_test.module
vicki@dev1-web:/var/www/html$ grep -ri _modules_uninstalled core/modules/| grep -v Test | awk -F: '{print $1}' | sort -u
core/modules/help_topics/help_topics.module
core/modules/language/language.module
core/modules/node/node.module
core/modules/system/system.module
core/modules/system/tests/modules/module_test/module_test.module
core/modules/system/tests/modules/system_test/system_test.module
core/modules/user/user.module

The API documentation for hook_modules_installed clearly states that it should be in .module and not .install. So, that should be moved.

Adding a patch.

quietone’s picture

Category: Bug report » Task
Priority: Normal » Minor

This is really a task.

quietone’s picture

spokje’s picture

Status: Needs review » Reviewed & tested by the community

- Reason for extension change clearly explained in #10.
- All other implementations of hook_modules_installed() are in *.module files
- Testbot is green

RTBC for me.

  • catch committed 831b208 on 9.3.x
    Issue #1306624 by quietone, joachim, Spokje: hook_modules_un/installed/...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed 831b208 and pushed to 9.3.x. Thanks!

Status: Fixed » Closed (fixed)

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