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.

CommentFileSizeAuthor
invoke-owner.patch652 bytesxjm
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

xjm’s picture

sun’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Testing system, -VDC

Thanks for splitting this out.

This is not caused by threading, but merely by module_hook().

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.

Unlike all other module_* functions, module_hook() does NOT account for module_exists(), but the code in question essentially makes that assumption. (And I consider the assumption to be right, and module_hook() to be wrong.)

In any case, the fix is correct.

xjm’s picture

Issue tags: +VDC

meep.

xjm’s picture

Issue summary: View changes

Updated issue summary.

xjm’s picture

Issue summary: View changes

Updated issue summary.

xjm’s picture

Commit message for this issue:

Issue #1850352 by tim.plunkett, xjm: Fixed config_import_invoke_owner() should check whether a module exists before invoking its hooks.
webchick’s picture

Status: Reviewed & tested by the community » Fixed

Seems 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!

xjm’s picture

sun’s picture

sun’s picture

Oh.

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

Anonymous’s picture

Issue summary: View changes

Updated issue summary.