Skip to:
Content

bbPress.org

Opened 3 weeks ago

Closed 3 weeks ago

#3696 closed defect (bug) (fixed)

Forum status AND check ignores an intermediate closed category

Reported by: johnjamesjacoby Owned by: johnjamesjacoby
Priority: normal Milestone: 2.6.20
Component: Component - Forums Version: 2.6.19
Severity: normal Keywords:
Cc:

Description

The documented AND behavior of bbp_is_forum_status() requires the forum and every category ancestor to match. With an open forum inside a closed category inside an open category, bbp_is_forum_status( $forum_id, 'open', true, 'AND' ) returns true instead of false.

The ancestor loop replaces the result for each category, so a matching outer category can erase an earlier mismatch. Accumulate the category results according to the selected AND or OR operator, preserving the existing filter arguments and non-category ancestor behavior. Add a nested-category PHPUnit regression test.

The issue is present in 2.6.19. Fix on trunk and backport to branches/2.6 for 2.6.20. The broader forum-template test coverage remains tracked in #3695.

Change History (2)

#1 @johnjamesjacoby
3 weeks ago

In 7768:

Forums: Preserve category status mismatches.

Combine each category ancestor's status with the preceding result so a matching outer category cannot erase an intermediate mismatch. Complete the forum status helper coverage and add a nested-category regression test.

In trunk, for 2.7.
See #3696.
See #3695.

#2 @johnjamesjacoby
3 weeks ago

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

In 7769:

Forums: Backport category status accumulation.

Preserve an intermediate category status mismatch when checking all forum ancestors. Add a regression test for nested categories without backporting the broader 2.7 test coverage.

In branches/2.6, for 2.6.20.
Fixes #3696.

Note: See TracTickets for help on using tickets.