| 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 |
|
|