boonebgorges / buddypress-group-email-subscription

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

restore_current_blog() call can trigger fatal on non-MS #236

Closed boonebgorges closed 1 year ago

boonebgorges commented 1 year ago

Introduced in 19ed2d85d3f5e033e67d544c92bd413df73a70df

boonebgorges commented 1 year ago

As reported in https://wordpress.org/support/topic/plugin-cant-be-activated-7/

r-a-y commented 1 year ago

Shouldn't the abstraction layer in BuddyPress support this? https://github.com/buddypress/buddypress/blob/94c69c211b480089472147f0d1dc4a23c226ad44/src/bp-core/bp-core-wpabstraction.php#L136-L150

I'm guessing that BuddyPress wasn't activated first?

boonebgorges commented 1 year ago

Yeah, it seems strange. There might be a race condition with the register_activation_hook() callback activitysub_setup_defaults(). I rarely use register_activation_hook() because I find its behavior so difficult to predict.