Skip to:
Content

bbPress.org

Opened 12 years ago

Closed 6 weeks ago

Last modified 6 weeks ago

#2649 closed defect (bug) (fixed)

Repair tools should also repair/recount sub forum count meta

Reported by: netweb Owned by: johnjamesjacoby
Priority: normal Milestone:
Component: Tools Version: trunk
Severity: major Keywords:
Cc: GDragoN

Description

Currently the repair tools do not repair/recount _bbp_forum_subforum_count counts.

To ensure the accuracy/integrity of our forum meta we should do this.

The most common occurrence of forums not having this meta data is if the forums were imported.

Change History (4)

#1 @netweb
12 years ago

  • Keywords needs-patch removed
  • Milestone Awaiting Review
  • Resolution → worksforme
  • Status new → closed

Closing as worksforme, _bbp_forum_subforum_count is actually recalculated when the repair tool "Recalculate last activity in each topic and forum" (bbp_admin_repair_freshness()) as part of bbp_update_forum()

#2 @GDragoN
7 years ago

  • Cc GDragoN added
  • Resolution worksforme
  • Severity normal → major
  • Status closed → reopened
  • Version → trunk

This recalculation is technically incorrect. This takes into account only public forums, ignoring private and hidden. Both private and hidden should be counted, especially when most forums require users to be logged in, and private forums are visible in such case.

Or, include three values: _bbp_forum_subforum_count, _bbp_forum_subforum_private_count, _bbp_forum_subforum_hidden_count.

#3 @johnjamesjacoby
6 weeks ago

  • Owner set to johnjamesjacoby
  • Resolution → fixed
  • Status reopened → closed

In 7453:

Counts: improve repair and subforum integrity.

Count public, private, and hidden subforums from the post hierarchy, and synchronize parent counts when forums change visibility, parent, post type, or are permanently deleted. Keep child relationship metadata aligned when WordPress reparents forums.

Correct count repair queries to target bbPress post types, honor filtered statuses, exclude anonymous authors, preserve unrelated metadata, repair empty user counts, clear metadata caches after direct database writes, and detect database failures from wpdb return values.

In trunk, for 2.7.

Props netweb, GDragoN.
Fixes #2649.
Fixes #2664.
See #2533, #2586, #3678.

#4 @johnjamesjacoby
6 weeks ago

In 7454:

Counts: improve repair and subforum integrity.

Count public, private, and hidden subforums from the post hierarchy, and synchronize parent counts when forums change visibility, parent, post type, or are permanently deleted. Keep child relationship metadata aligned when WordPress reparents forums.

Correct count repair queries to target bbPress post types, honor filtered statuses, exclude anonymous authors, preserve unrelated metadata, repair empty user counts, clear metadata caches after direct database writes, and detect database failures from wpdb return values.

Merges r7453 to 2.6.

In 2.6, for 2.6.16.

See #2533, #2586, #2649, #2664, #3678.

Note: See TracTickets for help on using tickets.