Summary

There is a problem with the crumbs_module_implements_alter() approach to splitting up the module file - first introduced in beta14.

The include files do not seem to be loaded at the correct time, leading to issues such as the breadcrumb not appearing: #2308037: Crumb disappeared (when displayed as block)

Steps to recreate

Install and enable beta13 of this module, set up a breadcrumb and configure the Crumbs block to appear somewhere.

Now upgrade to beta14 (or later) - the breadcrumb no longer appears.

Proposed solution

Remove the apparently unreliable approach of using hook_module_implements_alter() to split up the module file. It seems to create issues due to the weights of modules (see the discussion on the docs page for more information).

The attached patch removes this implementation and uses module_load_include instead - a simpler approach.

Comments

jkingsnorth’s picture

Patch attached.

donquixote’s picture

Title: Problems with crumbs_module_implements_alter() » Problems with crumbs_module_implements_alter() and hook_block_view()
Status: Needs review » Fixed

Fixed in 7.x-2.x-dev
http://cgit.drupalcode.org/crumbs/commit/?id=15b06bfe7fe1f0d9caf354e55d5...

I did not apply the full patch, only did a manual require_once.

See also http://drupal.stackexchange.com/a/129112/2974

module_invoke_all() always calls module_implements(), which checks the module include file by checking both hook_hook_info() and hook_module_implements_alter().

However, module_invoke() only checks hook_hook_info() and not hook_module_implements_alter().

module_invoke() is called e.g. in _block_render_blocks() for hook_block_view(). This means that hook_module_implements_alter() is not a good solution to split a hook_block_view() implementation into a separate file.

Status: Fixed » Closed (fixed)

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