Opened 14 years ago
Closed 14 years ago
#3540 closed defect (bug) (fixed)
Forum topics requested by AJAX do not include object/group name
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 1.5 | Priority: | minor |
Severity: | minor | Version: | |
Component: | Forums | Keywords: | has-patch 2nd-opinion |
Cc: |
Description
When you visit the sitewide forums directory, the byline of each topic includes the group name where the topic first appeared. When you change the view via AJAX, the returned results do not contain this information. The failure has to do with this check: http://buddypress.trac.wordpress.org/browser/trunk/bp-themes/bp-default/forums/forums-loop.php#L63 - bp_is_directory() is not returning true on these ajax requests.
Attachments (2)
Change History (4)
Note: See
TracTickets for help on using
tickets.
The problem is that $bp->is_directory gets set by bp_update_is_directory(), inside of the screen functions for each component. But when you're making an ajax request, the screen functions never get fired (the wp_ajax_ hooks come before bp_screens, and all output is killed after locate_template()).
I've attached a patch that does a sort of rudimentary check, during an ajax request, to see whether you're looking at a directory. It feels a bit hackish to me; we should probably be setting bp_update_is_directory() sooner. But that poses its own problems, of course, since BP has a tradition of doing all of its display checks really late. So I think this is probably as good a fix as we are going to get at the moment, and it's an edge case anyway.