In burst-statistics/burst.php, line 182:
if ( ! function_exists( 'burst_set_activation_time_stamp' ) ) {
/**
* Set an activation time stamp
*
* @param $networkwide
*/
function burst_set_defaults( $networkwide ) {
BURST()->admin->setup_defaults();
}
register_activation_hook( __FILE__, 'burst_set_defaults' );
}
As far as I can tell, the first if-condition will never be true, at least I couldn’t find any definition of a function called burst_set_activation_time_stamp.
Just changing that to burst_set_defaults didn’t help, though, the problem persists.
-
This reply was modified 3 years, 2 months ago by
McLibboc.
@mclibboc you are correct, this doesn’t work quite as expected right now. Thanks for reporting the issue.
– We realised that on multisite, the capability is not linked to administrators on who are only active on subsites. I’ve created a fix that adds the capability to all administrators on subsites as well, and also on new site creation:
https://github.com/Really-Simple-Plugins/burst/tree/capability
The function triggers on site activation.
– the if (function_exists) is a bug, but without consequences: this should protect from duplicate installation of Burst, but the if function exists contains the wrong function. As the function doesn’t exist, the activation hook will already run without issues. It will be corrected in the next update.
Let me know if this resolves the issue for you.
@rogierlankhorst thank you for your quick reply.
The issue remains:
- I have a multisite with many subsites already in use. I take it that the
wp_initialize_site hook will not trigger then? When is the assignment of capabilities to roles triggered in this case?
- It seems to me that you addressed the capability
manage_burst_statistics only, not the view_burst_statistics which is not implied but also needed.
Best regards,
McL
-
This reply was modified 3 years, 2 months ago by
McLibboc.
@mclibboc I noticed the set_defaults doesn’t run again when activated again, so I’ve included the functions in the upgrade process as well. It should now run on upgrade. When running the upgrade, all current subsites will be processed.
The wp_initialize_site is only triggered for new sites, to ensure the capabilities also get added on newly added sites.
I’ve extended this with the view capability as well.
@rogierlankhorst
That did the trick. Now it works as expected.
Thanks a lot.
-
This reply was modified 3 years, 2 months ago by
McLibboc. Reason: resolved