Opened 8 years ago
Closed 8 years ago
#3114 closed defect (bug) (fixed)
BuddyPress: AJAX subscription links fail
Reported by: | r-a-y | Owned by: | johnjamesjacoby |
---|---|---|---|
Milestone: | 2.6 | Priority: | high |
Severity: | normal | Version: | |
Component: | Extend - BuddyPress | Keywords: | has-patch |
Cc: |
Description
Reported here:
https://bbpress.org/forums/topic/bbpress-2-6-beta/page/3/#post-184865
There are a few issues with AJAX subscription links under a BuddyPress group:
- AJAX call 404s
- The localized topic ID is
0
instead of the actual topic ID.
To fix the 404, see 404.patch
.
The second issue is more complicated since using wp_localize_script()
to set the the topic data is too early to do when on a BuddyPress group topic page. Thus, I would recommend disabling AJAX for subscription links in BuddyPress groups. See no-ajax.patch
.
Attachments (7)
Change History (14)
#2
@
8 years ago
- Milestone changed from Awaiting Review to 2.6
- Owner set to johnjamesjacoby
- Priority changed from normal to high
03 looks great. Thanks @r-a-y!
#3
@
8 years ago
This will either end up in RC 4, or 2.6 proper.
I just tagged the next RC and missed this update.
#5
@
8 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
The check needs to be == 0
instead of === 0
because the numeric IDs from wp_localize_script()
are a string, so the comparison fails.
The alternative way to fix this is by casting those numeric IDs as integers when doing the check.
03.patch
adds adata-bbp-nonce
attribute to the link and modifies the JS to look for this attribute, which also fixes the problem. Also includes404.patch
.Disregard
01.patch
and02.patch
. Was a little quick on the trigger with those patches!