summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/context_reaction_block.inc22
1 files changed, 12 insertions, 10 deletions
diff --git a/plugins/context_reaction_block.inc b/plugins/context_reaction_block.inc
index 7a7b072..954d657 100644
--- a/plugins/context_reaction_block.inc
+++ b/plugins/context_reaction_block.inc
@@ -372,16 +372,18 @@ class context_reaction_block extends context_reaction {
drupal_alter('context_block_info', $block_info);
// Gather only region info from the database.
- $theme_key = variable_get('theme_default', 'garland');
- $result = db_select('block')
- ->fields('block', array('module','weight','delta','region'))
- ->condition('theme', $theme_key)
- ->condition('status', 1)
- ->execute();
- foreach ($result as $row) {
- if (isset($block_info["{$row->module}-{$row->delta}"])) {
- $block_info["{$row->module}-{$row->delta}"]->weight = $row->weight;
- $block_info["{$row->module}-{$row->delta}"]->region = $row->region;
+ if (module_exists('block')) {
+ $theme_key = variable_get('theme_default', 'garland');
+ $result = db_select('block')
+ ->fields('block', array('module','weight','delta','region'))
+ ->condition('theme', $theme_key)
+ ->condition('status', 1)
+ ->execute();
+ foreach ($result as $row) {
+ if (isset($block_info["{$row->module}-{$row->delta}"])) {
+ $block_info["{$row->module}-{$row->delta}"]->weight = $row->weight;
+ $block_info["{$row->module}-{$row->delta}"]->region = $row->region;
+ }
}
}
}