• Resolved LukeDouglas

    (@lukedouglas)


    I recently encountered an issue with MySites.guru not connecting properly to one of my client websites. Phil Taylor did research, found and fixed the issue. Here is what he stated which I think should be forwarded to the develpment team.

    The root cause of the problem is this error:

    18:10:27 | !!!!!! ERROR !!!!!! = Attempt to read property “roles” on bool in file /home/customkt/public_html/wp-content/plugins/woocommerce-wholesale-prices/includes/wc-admin-notes/class-wwp-install-acfw.php line: 157
    18:10:27 | !!!!!! EXCEPTION !!!!!! =in_array(): Argument #2 ($haystack) must be of type array, null given/home/customkt/public_html/wp-content/plugins/woocommerce-wholesale-prices/includes/wc-admin-notes/class-wwp-install-acfw.php:157

    This is caused by your running PHP 8.1 and plugins not fully compatible with PHP 8.1 specifically this code in class-wwp-install-acfw.php line: 157 which assumes that every user has a roles array – when it doesn’t. I have appended

    ?? []

    To the code so that if $user->roles is null then it returns an array so that is_array can work.

    The bug is in the plugin woocommerce-wholesale-prices

    This is resolved by added the compatible code above and now mySites.guru can connect without issues to this site and run a snapshot.`

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Josh Kohlbach

    (@jkohlbach)

    Hi @lukedouglas thanks for the heads up on this.

    We haven’t completed compatibility checks with PHP 8.1 yet (user base is still very small based on our usage tracking data).

    I’ll raise this up to be fixed in the next release but the quick solution would be to downgrade your PHP version to 8.0 or 7.4.

    Hope this helps! Appreciate you raising the big to us ??

    Thread Starter LukeDouglas

    (@lukedouglas)

    Manually edited the file. Works now under PHP 8.1.

    Plugin Author Josh Kohlbach

    (@jkohlbach)

    That’s great @lukedouglas! Glad that was the only tweak. We’ll be scheduling a full review of 8.1 soon. Keep an eye out for our release changelogs.

    We do have a 2.1.6 release coming soon which has already been finalized so you may need to reapply your patch if you want to upgrade to that. PHP 8.1 compat should be in the minor release after that.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘MySites not connecting’ is closed to new replies.