Opened 12 years ago
Closed 12 years ago
#2294 closed defect (bug) (fixed)
bbp_get_public_child_ids()'s cache key not unique in multisite
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 2.3 | Priority: | normal |
Severity: | normal | Version: | 2.2.3 |
Component: | General | Keywords: | dev-feedback |
Cc: |
Description
I have a multisite installation with bbpress 2.2.4. If I insert new topics programmatically via bbp_insert_topic(), the topic count isn't always increased.
During debugging I found this issue:
bbp_get_public_child_ids() is used to calculate the topic count in bbp_update_forum_topic_count() and uses the cache group "bbpress" with this key:
$cache_id = 'bbp_parent_public_' . $parent_id . '_type_' . $post_type . '_child_ids'; [...] $child_ids = wp_cache_get( $cache_id, 'bbpress' );
But this group is added as a global group in setup_globals():
wp_cache_add_global_groups( 'bbpress' );
So, in a multisite installation with multiple forums on different blogs, the key is not unique if 2 forums have the same id.
Maybe this isn't the only issue related with bbpress as a global cache group?
I'm not deep enough into bbpress, but are there any benefits of a global cache group at all? What, if I have different configurations in 2 installations? Would every cached value overwrite the individual option for each other blog, too?
Change History (4)
#2
@
12 years ago
Thank you John.
Is there any advantage of adding bbpress as a global group in the first place? Every installation uses the custom post types of each individual blog, right? Therefore it needs his own seperate caching. So if setup_globals() wouldn't call wp_cache_add_global_groups() it would be solved. Or am I missing something?
Good catch. There are a few other places bbPress uses its own cache keys, and they're going to suffer a similar fate. Too late for 2.3, but might be able to fit this into a 2.3.x release. Moving to 2.4 in the meanwhile.