Skip to:
Content

bbPress.org

Opened 8 months ago

Closed 8 months ago

Last modified 8 months ago

#3607 closed defect (bug) (fixed)

Search query with broken post statuses

Reported by: gdragon's profile GDragoN Owned by: johnjamesjacoby's profile johnjamesjacoby
Milestone: 2.6.12 Priority: highest omg sweet tea
Severity: critical Version: trunk
Component: Component - Search Keywords: has-patch commit
Cc:

Description

This has been a bug for a long time, but I noticed it only now due to some other change. But, in the includes/search/template.php, function bbp_has_search_results() starting on line 23, has an issue on line 50 where it initializes $post_statuses, it uses array_keys method, but the return from bbp_get_public_topic_statuses() is not associative array, so the result is wrong, and the list of statuses for search cause for no results to be returned (or maybe include only 'private' status.

Attachments (1)

template-search-3607.patch (513 bytes) - added by GDragoN 8 months ago.
Fix for the statuses.

Download all attachments as: .zip

Change History (3)

@GDragoN
8 months ago

Fix for the statuses.

#1 @johnjamesjacoby
8 months ago

  • Keywords commit added
  • Owner set to johnjamesjacoby
  • Status changed from new to assigned

#2 @johnjamesjacoby
8 months ago

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

In 7280:

Search: remove array_keys() from

This change ensures that the correct public statuses are used by default inside of the bbp_has_search_results() function, and it does this by using the values from bbp_get_public_topic_statuses() and not the keys.

This fixes a regression causing search results to omit public statuses as part of their default arguments.

Props GDragoN.

Fixes #3607.

Last edited 8 months ago by johnjamesjacoby (previous) (diff)
Note: See TracTickets for help on using tickets.