Iβm using a different forum structure (a forum index, subforums, etc. β a traditional phpBB layout
what are you using exactly??
I have a forum structure like: Forums > Forum > Subforum > Topic. After trashing a reply inside a topic the postmeta keys _bbp_last_active_id / _bbp_last_active_time / _bbp_last_reply_id for the parent forum and subforum get the wrong values (some old reply) or are sometimes even missing in case of using the admin repair tool for freshness.
Hum, I was wrong about the forum structure, it’s actually: Category > Forum > Subforum > Topic. Categories were changed to forums or subforums and forums were changed to subforums or categories a lot in the past. I guess I have to debug freshness and see where it gets the wrong recent posts and topics …
Categories were changed to forums or subforums and forums were changed to subforums or categories a lot in the past
you lost me here
I guess I have to debug freshness and see where it gets the wrong recent posts and topics β¦
make sure you followed all the troubleshooting tips here
Before Posting
other than that it would be tricky to find the issue
if you do find anything please report back
Initial forum structure:
Category 1
– Forum 1
— Subforum 1
– Forum 2
— Subforum 2
— Subforum 3
etc.
Changed forum strcture:
Forum 1 (changed to category)
– Subforum 1
— Forum 2
– Category 1 (changed to forum)
— Subforum 2
— Subforum 3
etc.
Situations like this happen all the time – clients whishing to move around or delete forums, subforums and categories.
But now to my observations about freshness. I think it’s a caching problem. The function bbp_update_topic_walker is responsible for all the calculations that happen when some changes to topics are made. Further it calls the function bbp_update_forum for all the topic ancestors. Inside there are calls to the functions bbp_update_forum_last_topic_id, bbp_update_forum_last_reply_id, bbp_update_forum_last_active_id and bbp_update_forum_last_active_time. Let’s concentrate on the function bbp_update_forum_last_reply_id: first it queries all the forums and subforums, then it queries topic ids and then it really gets interesting with the function bbp_forum_query_last_reply_id. π That function checks for an existing cache of a reply, which can return false or the contents of the cache (wp_cache_get) … Now, the problem is that this function returns 0 in my case! So, the new cache can’t be calculated and the freshness gets set to the first reply in the last topic or even nothing if it doesn’t get that value. Any ideas? (the admin repair tools don’t solve anything)
Structure shouldn’t be causing an issue.
But now to my observations about freshness. I think itβs a caching problem.
do you have cache on for logged in users?? it is usually recommended to not have cache for logged in users.
I’m running a copy of the website on my laptop (Mac OS X Yosemite, Apache, PHP, MySQL) without a persistent caching plugin. I don’t think logged in users have anything to do with this problem, because we’re talking about the WordPress/bbPress internal caching functions (WP Object Cache).
I’ve also slightly modified the bbp_forum_query_last_reply_id function to accept the value of 0 and run the query and then the wp_cache_get returns the correct value, but after reverting the changes wp_cache_get again returns 0. Do I need to clear the object cache (which is stored somewhere in the options table according to the WP Object Cache docs)?
your issue very well might be the same as the trac tickets you posted
but i cant confirm.
i suggest you contact the bbPress plugin developers in slack.
Development
Ok, thanks for your help.
Hi Ziga Sancin,
Did you find a solution for this problem?
-Mads
I rewrote the caching part of freshness output… However, the patch in bug #2414 fixed my issues, so I don’t need this workaround anymore.
Hi Ziga,
Hmm, weird. Even with latest build of 2.6 i still have an issue, with an imported database from phpbb. But thanks anyway π
-Mads