PHP Error on Activation
-
Hi!
The plugin (version 2.6.18) threw an error on activation in a newly set up multisite (but I believe it can also throw the error on a normal installation) on a PHP 8.4 host.
Caused by src/Upgrade/Ver2.php:
The lines$role = get_role( 'auto_listings_seller' );
$remove = array_keys( $role->capabilities );
throw an error sinceget_rolereturnes null on a fresh install (the queried role is not present yet) andarray_keysawaits an array as parameter.
You should be safe if you insert the following line in between:if ( empty( $role ) ) { return; }
resulting in$role = get_role( 'auto_listings_seller' );
if ( empty( $role ) ) { return; }
$remove = array_keys( $role->capabilities );
The topic ‘PHP Error on Activation’ is closed to new replies.