Skip to:

Opened 13 years ago

Closed 13 years ago

#3540 closed defect (bug) (fixed)

Forum topics requested by AJAX do not include object/group name

Reported by: boonebgorges's profile boonebgorges Owned by:
Milestone: 1.5 Priority: minor
Severity: minor Version:
Component: Forums Keywords: has-patch 2nd-opinion


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: - bp_is_directory() is not returning true on these ajax requests.

Attachments (2)

3540.01.patch (797 bytes) - added by boonebgorges 13 years ago.
3540.02.patch (2.1 KB) - added by johnjamesjacoby 13 years ago.
Adds comments to 3540.01.diff, and changes forum-loop.php to use !bp_is_group_forum() instead

Download all attachments as: .zip

Change History (4)

#1 @boonebgorges
13 years ago

  • Keywords has-patch 2nd-opinion added

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.

13 years ago

Adds comments to 3540.01.diff, and changes forum-loop.php to use !bp_is_group_forum() instead

#2 @boonebgorges
13 years ago

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

(In [5095]) Adds a manual check for bp->is_directory at the beginning of bp_dtheme_object_template_loader(). Switches logic of group metadata display in forum directories. Fixes #3540. Props boonebgorges, johnjamesjacoby

Note: See TracTickets for help on using tickets.