Skip to:
Content

bbPress.org

Opened 14 years ago

Closed 7 days ago

Last modified 7 days ago

#2233 closed defect (bug) (fixed)

bbPress Topic or Replies states bugs !

Reported by: alex-ye Owned by: johnjamesjacoby
Priority: normal Milestone: Future Release
Component: General Version: 2.2.3
Severity: normal Keywords: needs-patch
Cc: nashwan.doaqan@…

Description (last modified by netweb)

Hi , I had been reviewing how bbPress handle the post status like private,closed...etc , There are many bugs I will publish about them soon most of them need some WordPress modifications since WordPress core have a many bugs too in the post states system ...

This is a simple list of some bugs I have founding them nowdays :

1 ---[User Posts Counter]:

The user topics or replies count functions like bbp_get_user_topic_count_raw() , bbp_get_user_reply_count_raw() ...etc

a - Not exclude the private posts , Even for those users they can't read the private posts .
b - Not include the closed or spam ... etc topics or replies .

... etc

2 -- [The Back-end Interface]

There are some bugs in the wp-admin too , because WordPress core doesn't handle the post states in right way as I said a above .:

a - Try to edit a closed topic from the back-end , You will be surprised that the submit button text is "Publish" instead of "Save" , and even after this "Publish" button , the topic being "Open" instead of "Closed" and you need to close it a again !

... etc

I want from you to be aware about theses problems so we can help WordPress to make this easier to us especially for BuddyPress and bbPress developers .

Edit: The first part of item 1b has been extracted to ticket #2978

Change History (10)

#1 @alex-ye
14 years ago

  • Cc nashwan.doaqan@… added

#2 follow-up: @johnjamesjacoby
14 years ago

  • Milestone Awaiting ReviewFuture Release

These are known issues, though there's actually little that can be done about them until the post_status API's are fleshed out in WordPress core.

We could swap out storing these in post_meta, and instead push them to the object cache. That would make the counts more accurate, with a significant performance cost for users without a persistent object cache. It's something worth considering for a future version, or as a long term project for someone that's interested in picking it up.

#3 in reply to: ↑ 2 @alex-ye
14 years ago

Related : WordPress Trac #12706

#5 @netweb
10 years ago

bbPress has 8 posts statuses and in regard to post counts the following summary:

Two of these statuses are "public" and should be viewable by all users

  • bbp_get_public_status_id()
    • Already included
  • bbp_get_closed_status_id()
    • Created ticket #

The remaining 6

  • bbp_get_private_status_id() & bbp_get_hidden_status_id()
    • These counts should only be available to the user, moderators, and keymasters
  • bbp_get_pending_status_id(), bbp_get_spam_status_id() & bbp_get_trash_status_id()
    • These counts should only be available to moderators and keymasters
  • bbp_get_orphan_status_id()
    • This is a reserved status for posts with orphaned metadata, should only be available to keymasters

We could add another query or helper function to count a users closed topics and add this to the bbp_get_user_topic_count_raw() count, that would satisfy the core of the #meta1870 issue, I've created and added a patch to #2978 to implement just this.

Supporting any of the other statuses without #WP12706 would be a far more complicated for logged in/logged out permutations and combinations of the above, possibly similar topic/reply post status counts functions bbp_get_user_*status*_topic_count() / bbp_get_user_*status*_reply_count() could work here but I've not explored this fully.

#6 @netweb
10 years ago

  • Description modified (diff)

Edited the original ticket and removed the first part of item 1b, this has been extracted to ticket #2978

#7 @johnjamesjacoby
9 days ago

In 7449:

Counts: synchronize counts on post-status transitions.

Replace the mixed moderation callbacks with one persisted-status transition callback for topic, reply, forum, and user counts. Handle new public and hidden content, avoid changes for hidden-to-hidden transitions, preserve reply totals during approval, and repair missing user counts without double-counting the first contribution.

Remove the obsolete child-cache invalidation workaround, prevent topic metadata from being recreated after permanent deletion, recount hidden forum replies during deletion, preserve forum visibility when restoring forums, and order contribution queries for the WordPress post-count index.

In trunk, for 2.7.

Props netweb.
Fixes #2944.
Fixes #3429.
Fixes #3645.
See #1859, #2233, #3433.

#8 @johnjamesjacoby
9 days ago

In 7451:

Counts: synchronize counts on post-status transitions.

Replace the mixed moderation callbacks with one persisted-status transition callback for topic, reply, forum, and user counts. Handle new public and hidden content, avoid changes for hidden-to-hidden transitions, preserve reply totals during approval, and repair missing user counts without double-counting the first contribution.

Remove the obsolete child-cache invalidation workaround, prevent topic metadata from being recreated after permanent deletion, recount hidden forum replies during deletion, preserve forum visibility when restoring forums, and order contribution queries for the WordPress post-count index.

Merges r7449 to 2.6.

In 2.6, for 2.6.16.

See #1859, #2233, #2944, #3429, #3433, #3645.

#9 @johnjamesjacoby
7 days ago

  • Owner set to johnjamesjacoby
  • Resolutionfixed
  • Status newclosed

In 7467:

Counts: synchronize metadata across concurrent writes.

Introduce bbp_bump_count_meta() to update existing numeric metadata with bounded compare-and-swap retries while preserving WordPress metadata filters, actions, sanitization, and cache invalidation. Apply atomic differences to forum, topic, reply, ancestor, and user contribution counts.

Reconcile counts, engagements, and voices across status transitions, permanent deletion, author changes and reassignment, moderator move/merge/split operations, and repair recounts. Correct recursive forum totals and reply visibility, and preserve term-backed favorites and subscriptions during engagement rebuilds.

Document the count-hook compatibility changes and new helper arguments, and add regression coverage for single-site and multisite workflows.

In trunk, for 2.7.

Props alex-ye.
Fixes #2233.
Fixes #3678.

#10 @johnjamesjacoby
7 days ago

In 7468:

Counts: synchronize metadata across concurrent writes.

Introduce bbp_bump_count_meta() to update existing numeric metadata with bounded compare-and-swap retries while preserving WordPress metadata filters, actions, sanitization, and cache invalidation. Apply atomic differences to forum, topic, reply, ancestor, and user contribution counts.

Reconcile counts, engagements, and voices across status transitions, permanent deletion, author changes and reassignment, moderator move/merge/split operations, and repair recounts. Correct recursive forum totals and reply visibility, and preserve term-backed favorites and subscriptions during engagement rebuilds.

Document the count-hook compatibility changes and new helper arguments, and add regression coverage for single-site and multisite workflows.

Merges r7467 to 2.6.

In 2.6, for 2.6.16.

See #2233, #3678.

Note: See TracTickets for help on using tickets.