diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-01-14 06:20:15 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-01-14 06:20:15 +0000 |
commit | 8a70cd09ca92526fa78d75bce8a7843baa8f4a6b (patch) | |
tree | d021ed33a39b8dee89930ad5a1ea5be9a615ce2e /modules/forum | |
parent | 52e5064d3241784ed110a9f268b9b39eb24dac1b (diff) | |
download | brdo-8a70cd09ca92526fa78d75bce8a7843baa8f4a6b.tar.gz brdo-8a70cd09ca92526fa78d75bce8a7843baa8f4a6b.tar.bz2 |
#652048 by chx: Factor out the caching pattern from forum.
Diffstat (limited to 'modules/forum')
-rw-r--r-- | modules/forum/forum.module | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 53668052e..26513107a 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -637,21 +637,10 @@ function forum_block_view($delta = '') { break; } - $cache_keys = array_merge(array('forum', $delta), drupal_render_cid_parts()); - // Cache based on the altered query. Enables us to cache with node access enabled. - $query->preExecute(); - $cache_keys[] = md5(serialize(array((string) $query, $query->getArguments()))); - $block['subject'] = $title; - $block['content'] = array( - '#access' => user_access('access content'), - '#pre_render' => array('forum_block_view_pre_render'), - '#cache' => array( - 'keys' => $cache_keys, - 'expire' => CACHE_TEMPORARY, - ), - '#query' => $query, - ); + // Cache based on the altered query. Enables us to cache with node access enabled. + $block['content'] = drupal_render_cache_by_query($query, 'forum_block_view'); + $block['content']['#access'] = user_access('access content'); return $block; } |