[buddypress-trac] [BuddyPress] #3816: Returning a list of posts by tag keyword returns erroneous data

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Sat Dec 17 15:07:50 UTC 2011


#3816: Returning a list of posts by tag keyword returns erroneous data
--------------------------+-----------------------------
 Reporter:  info_sponge   |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Future Release
Component:  Forums        |     Version:  1.5.1
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+-----------------------------
Changes (by boonebgorges):

 * milestone:  1.6 => Future Release


Comment:

 OK, I've been digging through this a bit more, and I have a few thoughts
 about it.

 First, our forum functions are simply not designed to query against a tag
 *and* a search term at the same time. I have dug into BB_Query a bit, and
 I guess this actually isn't a limitation of bbPress - it's just a problem
 with our implementation. Search terms and tags get passed through our
 query stack via the same parameter, and tags always win out. You can read
 through the logic starting at
 http://buddypress.trac.wordpress.org/browser/tags/1.5.2/bp-forums/bp-
 forums-template.php#L307. Note how, when it's a tag query, the
 search_terms passed to the loop are simply overridden. (Later in the
 chain, it becomes part of a generic 'filter' parameter.) I don't really
 understand the logic behind this decision; it goes back at least to
 http://buddypress.trac.wordpress.org/changeset/2641.

 Second, I'm afraid I'm not 100% certain I understand (and can reproduce)
 the exact problem as you've described it in the linked forum post. When I
 do tag queries or searches, the total topic count is calculated correctly.
 It could be that your issue only really arises in cases where you're
 trying to do a tag AND a search query at the same time, in which case
 fixing the topic count would be a band-aid on a larger and still
 unresolved issue (see previous paragraph). Or it could be that I'm
 misunderstanding your bug report. When you say "subsequent return values",
 does that mean that you're doing more than one bp_has_forum_topics() loop
 *on the same page*?

 It'd be possible to rewrite relevant sections of bp_has_forum_topics(),
 and the rest of the BP chain that leads to the query, so that it handles
 tags and search terms together properly. However, this will be a lot of
 work (both for the code and for the testing). And the deprecation of
 bbPress 1.x integration is slated to begin with BP 1.6 (see
 http://buddypress.trac.wordpress.org/ticket/3598), so all of that work
 would have an increasingly limited impact. Given this fact, and given the
 amount of work remaining on the rest of the milestone
 http://buddypress.trac.wordpress.org/report/3, I'm wary of spending the
 time to patch this myself.

 I would be delighted to work with someone who wanted to make a first go at
 such a patch, of course. But, barring that, I think that this ticket will
 probably get marked wontfix. Or, if I'm totally misunderstanding
 everything, please let me know about that too :)

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/3816#comment:2>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list