Skip to:
Content

BuddyPress.org

Opened 4 months ago

Closed 4 months ago

#9089 closed defect (bug) (fixed)

Only run 'bp_parse_query' hook once during AJAX

Reported by: r-a-y's profile r-a-y Owned by: imath's profile imath
Milestone: 12.3.0 Priority: normal
Severity: normal Version: 12.0.0
Component: Core Keywords: has-patch commit
Cc:

Description (last modified by r-a-y)

Ran into an issue in BuddyPress 12 where the 'bp_parse_query' hook was running more than once during AJAX requests.

The issue is in the bp_parse_ajax_referer_query() function. If another piece of code runs a WP_Query on a BuddyPress AJAX action, then the 'parse_query' hook will run, which would lead to the 'bp_parse_query' hook firing again.

I've attached a fix so we will remove subsequent calls to bp_parse_ajax_referer_query().

Attachments (1)

9089.01.patch (419 bytes) - added by r-a-y 4 months ago.

Download all attachments as: .zip

Change History (5)

@r-a-y
4 months ago

#1 @r-a-y
4 months ago

  • Description modified (diff)

#2 @imath
4 months ago

  • Keywords commit added

Hi @r-a-y

Thanks a lot for your catch & patch 💪. @slaffik I wonder if what describes & fixes r-a-y is also fixing the issue you told me about with the Query Monitor plugin.

#3 @imath
4 months ago

In 13735:

Make sure the bp_parse_query hook is only fired once when doing Ajax

Props r-a-y

See #9089

#4 @imath
4 months ago

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

In 13736:

Make sure the bp_parse_query hook is only fired once when doing Ajax

Props r-a-y

Fixes #9089 (branch 12.0)

Note: See TracTickets for help on using tickets.