The following line appears 3 times in context/plugins/context_reaction_block.inc

module_load_include('module', 'block', 'block');

Few problems with this.
1) context.info does not list dependency on block module
2) hard coding manually loading block.module code creates conflict with mongodb_block.module which is part of http://drupal.org/project/mongodb (in short any other provider of blocks functionality conflicts with block.module)
3) **Horrible** block.module is loaded on every page view regardless of module status (meaning its being loaded even when explicitly disabled in admin modules page). Marking this a major bug for this.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tekante’s picture

Status: Active » Needs review
FileSize
1009 bytes

Attached is a patch that will cause context to conditionally activate the block plugin based on whether the block module is enabled. I took a look at the mongodb_block module and was wondering if there exists an abstraction layer such that context's block plugin could use whatever block provider was being used for a site. It did not seem like this was going to be feasible and thus a mongodb block reaction plugin for context would likely be necessary but I thought I'd check. Let me know how the patch works for you.

js’s picture

I am checking in on this issue because I am at a point of deciding on mongodb_block. I have been using Context, which is great, but the site needs to be faster.

I don't yet know how much it would benefit from mongodb_block, but it would be nice to have both.

mgifford’s picture

Any progress on this? I'm just looking at issues about MongoDB now.

tekante’s picture

Current status on this issue is: Patch from comment 1 should remove the block dependency but it also removes the context block reaction.

In order to have a block reaction while using mongodb_block a mongodb_block specific block reaction plugin will need to be written. Any information about whether an abstraction layer for blocks exists such that the normal context block reaction could work for any block providing backend would be welcome.

Charlouze’s picture

Here is a patch that allows not to disable the block reaction features.

To use another block backend, this backend has to define two functions that must act like the one defined by the block module:
- module_block_get_renderable_array that must act like _block_get_renderable_array
- module_block_render_blocks that must act like _block_render_blocks
Also, you have to add the code below in settings.php

$conf['context_block_backend'] = 'module'; 

If you think this is a good fix for this issue. The block backend configuration can be added to the administration of context.

EDIT: In order for this patch to work with mongodb_block module, you have to patch mongodb_block module with the one I sent in this issue

jyee’s picture

reroll of #5 for the latest dev (revision: 16aa5ae).

edit: this should apply cleanly, however context+mongodb_block does not appear to work, so this may need a more thorough rewrite.

Charlouze’s picture

If you want this to work with mongodb_block you have to patch mongodb_block ... see this issue