Plugin could not be activated because it triggered a fatal error.
-
Hi,
Using this plugin on multi site instance. When trying to enable I get:
Plugin could not be activated because it triggered a fatal error. Fatal error: Uncaught Error: Call to a member function add_cap() on null in xxx/public_html/wp-content/plugins/age-gate/src/Update/Activate.php:171 Stack trace: #0 xxx/public_html/wp-content/plugins/age-gate/src/Update/Activate.php(60): AgeGate\Update\Activate->setCapabilities('3.0.9', false) #1 xxx/public_html/wp-content/plugins/age-gate/age-gate.php(46): AgeGate\Update\Activate::activate() #2 xxx/public_html/wp-includes/class-wp-hook.php(308): age_gate_activate('') #3 xxx/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array) #4 xxx/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #5 xxx/public_html/wp-admin/plugins.php(194): do_action('activate_age-ga...') #6 {main} thrown in xxx/public_html/wp-content/plugins/age-gate/src/Update/Activate.php on line 171
Corresponding error related to these lines of code:
// administrator $admin = get_role('administrator'); foreach (Constants::AGE_GATE_PERMISSION_ARRAY as $cap) { $admin->add_cap($cap); }
There are two sites on my multi site instance. On one it is working and on other I get this error described above.
Couldn’t find similar issue. Any thoughts?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Plugin could not be activated because it triggered a fatal error.’ is closed to new replies.