Skip to:
Content

Opened 6 years ago

Last modified 4 years ago

#2302 new defect

Favorite/Subscribe AJAX doesn't work inside BP Group Forums

Reported by: MZAWeb Owned by: MZAWeb
Milestone: 2.8 Priority: normal
Severity: normal Version: 2.1
Component: General Keywords: needs-patch
Cc: wordpress@…

Description

In #1905 we introduced the pure wp_ajax handlers in the theme. Seems that the correct scripts are not loading in BP group forums.

Reported here: http://bbpress.org/forums/topic/enqueue-ajax-script-in-buddypress-groups-forum/

Change History (10)

#1 @MZAWeb
6 years ago

  • Cc wordpress@… added

@johnjamesjacoby this shouldn't be too hard to fix, but I'd love to discuss with you the approach.

I'd assume we don't want to use BP template tags in templates/default/bbpress-functions.php, where the ajax handlers + script loaders are defined (now it's only checking for bbp_is_single_topic()).

I'd also assume we don't want to replicate almost the same code in includes/extend/buddypress/group.php.

But BBP_Default is not a singleton, and the instance is not being saved anywhere (new BBP_Default();), so to be able to re-use the same code we'll need to refactor or extract it somewhere and hook from both classes, leaving the appropriate conditionals in each one.

#2 @MZAWeb
6 years ago

User is reporting that he's not seeing the problem on the latest trunk. I'm still having the same issue with both bb's trunks.

Anyone can test and confirm?

#3 @johnjamesjacoby
6 years ago

  • Milestone changed from Awaiting Review to 2.4

This is a known issue for now, and will require a bit of a rethink to fix. The ajax lives inside of the theme/theme compat, because I don't want these things to be requirements in bbPress core. That said, we shouldn't duplicate any code, either.

Moving to 2.4 so we can discuss more.

#4 @johnjamesjacoby
6 years ago

  • Milestone changed from 2.4 to 2.5

Still an issue, but no movement in 2.4. Punting to 2.5.

#5 @MZAWeb
6 years ago

@johnjamesjacoby I was thinking of moving all the AJAX functionality to a new BBP_Default_AJAX class that can be instantiated both from bbp's themecompat and bp's themecompat without having to add it to bbp core. What do you think?

#6 @johnjamesjacoby
6 years ago

  • Milestone changed from 2.5 to 2.6

Let's iterate on how we want to handle ajaxifying bbPress going forward. There are other things to consider, like ajax reply posting, and whether or not we'd want to add that to theme compat, or add listeners into core.

Moving to 2.6.

#7 @johnjamesjacoby
5 years ago

Another report (#2432)

#8 @johnjamesjacoby
5 years ago

  • Milestone changed from 2.6 to 2.7

Bump to 2.7.

#9 @netweb
5 years ago

Just a note that it doesn't quite work with bbPress either:

When toggling Subscribe it toggles to | Subscribe rather then Subscribed, you can see this on bbpress.org.

Favorite works correctly toggling to Favorited

#10 @johnjamesjacoby
4 years ago

  • Milestone changed from 2.7 to 2.8

Bumping all 2.7 to 2.8 milestone.

Note: See TracTickets for help on using tickets.