Opened 9 years ago
Closed 9 years ago
#3114 closed defect (bug) (fixed)
BuddyPress: AJAX subscription links fail
| Reported by: | r-a-y | Owned by: | johnjamesjacoby |
|---|---|---|---|
| Priority: | high | Milestone: | 2.6 |
| Component: | Extend - BuddyPress | Version: | |
| Severity: | normal | 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
0instead 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
@
9 years ago
- Milestone Awaiting Review → 2.6
- Owner set to
- Priority normal → high
03 looks great. Thanks @r-a-y!
#3
@
9 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
@
9 years ago
- Resolution fixed
- Status closed → 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
03.patchadds adata-bbp-nonceattribute to the link and modifies the JS to look for this attribute, which also fixes the problem. Also includes404.patch.Disregard
01.patchand02.patch. Was a little quick on the trigger with those patches!