/[drupal]/contributions/modules/advcache/DRUPAL-5-6/forum_cache.patch
ViewVC logotype

Diff of /contributions/modules/advcache/DRUPAL-5-6/forum_cache.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1 by robertDouglass, Fri Jul 18 20:54:49 2008 UTC revision 1.2 by mikejoconnor, Thu Feb 26 13:39:12 2009 UTC
# Line 0  Line 1 
1    diff -Naur ../drupal/modules/forum/forum.module ./modules/forum/forum.module
2    --- ../drupal/modules/forum/forum.module        2007-08-08 02:27:22.000000000 -0400
3    +++ ./modules/forum/forum.module        2007-12-10 12:34:14.986201561 -0500
4    @@ -709,6 +709,17 @@
5      */
6     function forum_get_forums($tid = 0) {
7    
8    +  // This caching breaks forum access! The results of db_rewrite_sql will
9    +  // be cached, meaning the first user to load this node after a cache
10    +  // refresh will set the permissions for everyone. If you are using a module
11    +  // that does query rewriting on forum queries, don't use this patch.
12    +  // If you're not sure whether or not this is the case, don't use this patch!
13    +  $cache = cache_get('forums::'. $tid, 'cache_forum');
14    +  if ($cache) {
15    +    $forums = unserialize($cache->data);
16    +    return $forums;
17    +  }
18    +
19       $forums = array();
20       $_forums = taxonomy_get_tree(variable_get('forum_nav_vocabulary', ''), $tid);
21    
22    @@ -754,6 +765,8 @@
23         $forums[$forum->tid] = $forum;
24       }
25    
26    +  cache_set('forums::'. $tid, 'cache_forum', serialize($forums));
27    +
28       return $forums;
29     }
30    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.3