[buddypress-trac] [BuddyPress Trac] #8035: Nouveau: AJAX filter in Friends Requests returns incorrect and incorrectly-formatted results (was: Fatal mistake while using AJAX filter in Friends Requests)

buddypress-trac noreply at wordpress.org
Wed Jan 9 20:08:53 UTC 2019

#8035: Nouveau: AJAX filter in Friends Requests returns incorrect and incorrectly-
formatted results
 Reporter:  oxibug                                  |       Owner:  (none)
     Type:  defect (bug)                            |      Status:  new
 Priority:  normal                                  |   Milestone:  5.0.0
Component:  Friends                                 |     Version:  3.0.0
 Severity:  major                                   |  Resolution:
 Keywords:  dev-feedback has-screenshots has-patch  |
Changes (by boonebgorges):

 * keywords:  has-screenshots needs-patch dev-feedback => dev-feedback has-
     screenshots has-patch
 * priority:  omg pizza => normal
 * version:  4.1.0 => 3.0.0
 * milestone:  Awaiting Review => 5.0.0


 Hi @oxibug - Thanks for the ticket!

 I see two issues:

 1. The incorrect results are being returned from the AJAX request. It's
 querying for all members instead of just friend requests.

 2. The structure of the post-AJAX markup is not correct (as you note in
 your screenshots)

 It looks to me like this part of the interface may not have been fully
 reviewed when Nouveau was built - there's some copypasta from Legacy that
 doesn't totally work :) And, since Legacy doesn't support the 'filter' on
 /friends/requests, it's kinda broken in Nouveau too.

 The attached patch fixes it, though I'd like a second look (from @imath
 perhaps?) to see if I'm following Nouveau conventions closely enough. The
 critical parts are:

 1. To fix the markup issues, I had to create a new `requests-loop`
 2. That `requests-loop` template now uses `bp_ajax_querystring()`, which
 lets the AJAX filters work.
 3. To make the AJAX request fetch membership requests rather than all
 members, I had to do some customization of the `template` value sent in
 the AJAX request. I used group membership requests as a benchmark for
 this, but the case is slightly different here, since there's built-in
 logic in Groups to look at `bp_current_action()`, but not in Members. See

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

More information about the buddypress-trac mailing list