boonebgorges / buddypress-group-email-subscription

Fine-grained email subscription for activity in BuddyPress groups
35 stars 31 forks source link

Clicking on email setting in a group goes to 404 page #222

Closed roly151 closed 6 months ago

roly151 commented 2 years ago

We have Buddyboss installed along with your plugin. Our issue is that when a user goes into a group page, and clicks to choose the email setting they want (No Email, Daily Digest...etc) it takes them to a 404 page.

As an example, this is the url that they are taken to: https://ofclearn.com/groups/ofc-physiotherapists/;/

All 404 url's have the /;/ at the end.

Site is free to register on: https://ofclearn.com

boonebgorges commented 2 years ago

This suggests that there's a JavaScript error on the page. Open your JS console and look for errors when loading the page or clicking the button.

contemplate commented 2 years ago

I'm having the same issue after upgrading our Buddyboss platform. No JS errors reported in the console. Apparently this has been happening for a few weeks. Buddyboss Platform 2.0.2 Buddyboss Platform Pro 2.0.2 Buddyboss Theme 2.0.2

boonebgorges commented 2 years ago

Sorry to hear you're having problems. Unfortunately, the BuddyBoss platform is a proprietary tool, and I don't access to it, nor do I have the resources to debug it. My guess is that they've made a change so that the BPGES JavaScript file no longer properly loads on this page, or perhaps the CSS selectors have changed so that the click event is no longer detected. In any case, you'll have to reach out to the BuddyBoss support team for further help.

contemplate commented 2 years ago

Yes I'm working on debugging this myself. Good news is the user's subscription selection is saved before the 404 so it's just fixing the JS. Curious is this the js file I should look for the selector in? bp-activity-subscription-js.js

I did notice custom CSS I had added had not applied as well so I do think they changed a selector.

boonebgorges commented 2 years ago

Yes. See especially https://github.com/boonebgorges/buddypress-group-email-subscription/blob/master/bp-activity-subscription-js.js#L62=

contemplate commented 2 years ago

Ok on the Groups directory everything works fine.

On the single group page is where the issue is.

However I notice the subscribe links are different on each view:

Screen Shot 2022-05-31 at 10 47 38 AM Screen Shot 2022-05-31 at 10 48 03 AM
contemplate commented 2 years ago

@boonebgorges can I send you a copy of Buddyboss Platform / Theme for you to attempt to debug further? I tried reaching out to the Buddyboss theme but that went nowhere.

boonebgorges commented 2 years ago

Hi @contemplate - You're welcome to send them to me (my github username at gmail dot com). If I find some time in the next few weeks, I may try to debug this. But in general, I don't have the resources, as an individual, to do deep debugging of a proprietary tool.

contemplate commented 2 years ago

Done! Thanks so much.

johnmetzler commented 2 years ago

Was a solution to this found? I'm experiencing the same problem as contemplate and roly151.

contemplate commented 2 years ago

Still waiting on one @johnmetzler

boonebgorges commented 2 years ago

Hi all - Sorry to report that, as above, I haven't had the resources to debug the paid BuddyBoss tool. If anyone is able to devote the time to diagnosing the issue, please feel free to post your findings here, and we'll see if we can do something in BPGES to address the incompatibility.

johned78 commented 1 year ago

@boonebgorges the problem is in the buddyboss-platform plugin in bp-templates/bp-nouveau/buddypress/groups/single/cover-image-header.php on around line 122 it is outputting the hooked content with wp_kses_post hence it is stripping js strings, I have debugged through every stage and it was fine till here. There is no way to hook into this..

The temporary working fix as there is not much else possible (I have tried!) is edit bp-activity-subscription-js.js in your plugin and prevent default on the click event. Hopefully you can patch now and update us when it is done as my client wont be able to update the plugin till you fix it.

boonebgorges commented 1 year ago

Hi @johned78 - Thanks so much for the detailed debugging. Is this what you did? https://github.com/boonebgorges/buddypress-group-email-subscription/commit/90a0f2b5d24ab411888c605ad997a32e0bac5c46 If so, could others confirm that it fixes the issue for them as well?

johned78 commented 1 year ago

@boonebgorges yep that was the easy part, trailing through the other plugin was the mission.

contemplate commented 1 year ago

Amazing work @johned78. I'll test this patch on a few client sites later today and report back here.

contemplate commented 1 year ago

Confirmed @boonebgorges that this solution works!! THANK YOU @johned78

boonebgorges commented 1 year ago

Awesome! @contemplate Thanks for confirming, and @johned78 huge thanks for providing the fix. I've merged the change and it will be part of the next 4.0.x release. In the meantime it should be safe to patch your version of the plugin.