--- esi.orig.inc	2010-08-24 23:23:36.000000000 +0200
+++ esi.inc	2010-11-21 20:10:27.000000000 +0100
@@ -69,9 +69,22 @@ function _esi__get_block($theme, $region
   global $theme_key;
   $theme_key = $theme;
   init_theme();
-  
-  $blocks = block_list($region);
-  return $blocks["{$module}_{$delta}"];
+  if (module_exists("context")){
+    // the normal block_list function will return an empty list as block placement is handled by context module  
+    $array = module_invoke($module, 'block', 'view', $delta);
+    if (isset($array) && is_array($array)) {
+      foreach ($array as $k => $v) {
+        $block->$k = $v;
+      }
+    }
+    $block_info = context_cache_get('block_info');
+    $block->bid = "{$module}-{$delta}";
+    $block->cache = isset($block_info[$block->bid]->cache) ? $block_info[$block->bid]->cache : BLOCK_NO_CACHE;
+    return $block;
+  } else {
+    $blocks = block_list($region);
+    return $blocks["{$module}_{$delta}"];
+  }
 }
 
 /**
