Skip to:
Content

bbPress.org

Opened 12 years ago

Closed 11 years ago

#2303 closed enhancement (fixed)

$check_ancestors Parameter Logic

Reported by: alex-ye's profile alex-ye Owned by: johnjamesjacoby's profile johnjamesjacoby
Milestone: 2.6 Priority: normal
Severity: normal Version: 2.2.3
Component: Tools - Code Improvements Keywords: has-patch needs-testing early
Cc: nashwan.doaqan@…

Description

Hi :), It seems that I used the "logic" word a lot in my last tickets :D

Anyway, This ticket is to enhance the functions that have the parameter $check_ancestors=true like:
bbp_is_forum_public()
bbp_is_forum_private()
bbp_is_forum_hidden()
bbp_is_forum_closed()
bbp_is_forum_open()

From my view, all the functions are different in their logical operator:

bbp_is_forum_public() and bbp_is_forum_open() : They must check all the forums in the tree to make
sure that all of them are match. which called "AND" operator.

So when you check if a forum is public, It must check all the ancestors too.

bbp_is_forum_private(),bbp_is_forum_hidden() and bbp_is_forum_closed() : They just need to check if
one forum from the tree is match, which called "OR" operator.

So, No need to check the ancestors status if the forum it self is private!

Attachments (5)

forums-template-tags.patch (13.9 KB) - added by alex-ye 12 years ago.
First Draft Patch
forums-template-tags-2.patch (13.6 KB) - added by alex-ye 12 years ago.
Second Draft Patch
forums-template-tags-3.patch (13.2 KB) - added by alex-ye 12 years ago.
forums-template-tags-4.patch​ (11.8 KB) - added by netweb 11 years ago.
2303-5.diff (11.8 KB) - added by netweb 11 years ago.

Download all attachments as: .zip

Change History (16)

@alex-ye
12 years ago

First Draft Patch

#1 @johnjamesjacoby
12 years ago

  • Keywords needs-testing added
  • Milestone changed from Awaiting Review to 2.4

This makes sense. Moving to 2.4 to check the patch and do some testing.

@alex-ye
12 years ago

Second Draft Patch

#2 @alex-ye
12 years ago

Fixing bbp_is_forum_open() function , and have some notes:

1- Why bbPress doesn't have bbp_get_opened_status_id() function?
2- If bbPress forum status is only 'Opened','Closed' why we not make this a checkbox instead of a dropdown in the admin UI?

#3 @alex-ye
12 years ago

  • Cc nashwan.doaqan@… added

#4 @alex-ye
12 years ago

In the third patch:

1- Remove not-needed bbp_is_forum_visibility_id and bbp_is_forum_status_id filters.
2- Make the patch index from the ROOT.
3- Remove the trailing spaces.

Give it a test and better docs :)

#5 @johnjamesjacoby
12 years ago

  • Keywords early added
  • Milestone changed from 2.4 to 2.5

Good iteration here. Going to move this to 2.5 so it can get in earlier and have more time to test.

#6 @johnjamesjacoby
11 years ago

  • Milestone changed from 2.5 to 2.6

Bump to 2.6.

#7 @netweb
11 years ago

forums-template-tags-4.patch is a refreshed patch of forums-template-tags-3.patch

#8 @johnjamesjacoby
11 years ago

  • Owner set to johnjamesjacoby

@netweb
11 years ago

#9 @netweb
11 years ago

In 2303-5.diff​, refreshed patch against /trunk (Refresh of 'forums-template-tags-4.patch​​')

#10 @alex-ye
11 years ago

Thanks @netweb :)

#11 @johnjamesjacoby
11 years ago

  • Resolution set to fixed
  • Status changed from new to closed

In 5499:

Enable forum status and visibility functions to check ancestry by extracting existing logic into new helper functions. Props alex-ye, netweb. Fixes #2303.

Note: See TracTickets for help on using tickets.