Bug #15877
closedFix 'Follow' button behavior on new Sites directory
0%
Description
As part of the Sites directory redesign, I tried mimicking the Follow button as it currently appears on the Commons production site. See https://github.com/cuny-academic-commons/cac/blob/098681fbec154d02e58d0e5e6fb15c44001e5ce2/wp-content/themes/bp-nelo/functions.php#L1499=
But the button doesn't work. It seems like the buddypress-followers JS is broken in a couple ways:
a. It doesn't appear to have a listener for the blogs/sites directory
b. The way it identifies the nonce requires parsing the URL in a particular way - the ampersand has to appear in a certain way. This is a bit wonky.
c. I managed to work around a and b https://github.com/cuny-academic-commons/cac/blob/098681fbec154d02e58d0e5e6fb15c44001e5ce2/wp-content/themes/bp-nelo/assets/js/directory.js#L20= but I got a 400 error - like maybe the AJAX handler wasn't set up properly.
Ray, I didn't want to touch buddypress-followers itself, and I thought you might have a clearer idea what I'm doing wrong. Thanks in advance for your help!
Files