Issue #1850352 by tim.plunkett, xjm: Fixed config_import_invoke_owner() should check whether a module exists before invoking its hooks.
(From #1806334: Replace the node listing at /node with a view and #1776830: [META-1] Installation and uninstallation of configuration provided by a module that belongs to another module's API.)
At the moment, during test runs, config_import_invoke_owner() will try to invoke config hooks that don't exist because a module is not installed. module_hook() will discover that the function exists if the module is enabled in the parent site environment or on testbot (I guess because of threading).
Attached resolves the issue and I don't see any negative side effects from adding this check, though it is potentially just a workaround for a deeper problem in the testing system.
| Comment | File | Size | Author |
|---|---|---|---|
| invoke-owner.patch | 652 bytes | xjm |
Comments
Comment #1
xjmComment #2
sunThanks for splitting this out.
This is not caused by threading, but merely by
module_hook().module_hook()is a simplefunction_exists()in its most basic case, which can return a false-positive, depending on whether a .module file has been loaded.Unlike all other module_* functions,
module_hook()does NOT account formodule_exists(), but the code in question essentially makes that assumption. (And I consider the assumption to be right, andmodule_hook()to be wrong.)In any case, the fix is correct.
Comment #3
xjmmeep.
Comment #3.0
xjmUpdated issue summary.
Comment #3.1
xjmUpdated issue summary.
Comment #4
xjmCommit message for this issue:
Comment #5
webchickSeems like "module_hook() is a simple function_exists() in its most basic case, which can return a false-positive, depending on whether a .module file has been loaded." would be a good thing to get a test for, in a follow-up.
Committed and pushed to 8.x. Thanks!
Comment #6
xjmFiled #1850988: Should module_hook() check module_exists()?.
Comment #7
sunCreated #1850992: Make module_hook() check for module_exists() first
Comment #8
sunOh.
Comment #9.0
(not verified) commentedUpdated issue summary.