summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryoung hahn2010-04-26 18:20:36 (GMT)
committer young hahn2010-04-26 18:20:36 (GMT)
commit7e515e74b30200331fb26c2b60da9d2d9b68632c (patch)
tree0dd1c146745dc306fc719fb9a0ea49c11b9c8b9d
parente11545f06974b3dd6c3eb9dc5d1c6ad225607d6e (diff)
Ensure block info cache is not stale after administrative actions alter block info (e.g. creating new views)
-rw-r--r--plugins/context_reaction_block.inc11
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/context_reaction_block.inc b/plugins/context_reaction_block.inc
index ea54b25..46db122 100644
--- a/plugins/context_reaction_block.inc
+++ b/plugins/context_reaction_block.inc
@@ -330,9 +330,16 @@ class context_reaction_block extends context_reaction {
static $block_info;
if (!isset($block_info) || $reset) {
- // We don't retrieve the block info cache when on admin pages as a
+ $block_info = array();
+
+ // Force a reset of the block info cache when on admin pages as a
// variety of administrative UI tasks can create or alter block info.
- $block_info = $reset || arg(0) === 'admin' ? array() : context_cache_get('block_info');
+ if (arg(0) === 'admin') {
+ context_cache_set('block_info', NULL);
+ }
+ else if (!$reset) {
+ $block_info = context_cache_get('block_info');
+ }
if (empty($block_info)) {
$block_info = array();
foreach (module_implements('block') as $module) {