• Resolved Bhavesh Patel

    (@bhaveshnariya)


    Hi,

    I updated plugin to latest version today and it starts throwing fatal error. I have to downgraded to 7.5.3 and it starts working well. Below is error with version 7.6.0

    I have resaved settings as well but still did not work.

    PHP Fatal error: Uncaught TypeError: array_merge(): Argument #1 must be of type array, null given in /wp-content/plugins/restricted-site-access/restricted_site_access.php:427

    Thank you

Viewing 10 replies - 1 through 10 (of 10 total)
  • Same issue here.
    In addition to throwing the error – this error breaks editing specifically with Elementor.

    Plugin Support Darin Kotter

    (@dkotter)

    Thanks for the report. Note we are tracking this on GitHub here: https://github.com/10up/restricted-site-access/issues/370, with a PR opened to fix this: https://github.com/10up/restricted-site-access/pull/371

    I’ve not been able to reproduce the problem myself so if you have more information about your environment/setup, that would be helpful here. Or if you have time to test that PR to ensure it fixes things for you, that would also help.

    Looking to get that fix out within the next day or two.

    I’m experiencing same fatal error with the Restricted Site Access plugin version 7.6.0 on WordPress. The error occurs repeatedly and prevents the site from functioning properly.
    Error:
    PHP Fatal error: Uncaught TypeError: array_merge(): Argument #1 must be of type array, null given in /path/to/wp-content/plugins/restricted-site-access/restricted_site_access.php:427
    Stack trace:
    0 /path/to/wp-content/plugins/restricted-site-access/restricted_site_access.php(427): array_merge(NULL, NULL) 1 /path/to/wp-content/plugins/restricted-site-access/restricted_site_access.php(247): Restricted_Site_Access::get_options() 2 /path/to/wp-includes/class-wp-hook.php(324): Restricted_Site_Access::hide_admin_bar_for_roles(true)
    Root cause:
    The issue occurs on line 427 of restricted_site_access.php in the get_options() method. The static properties self::$fields and self::$always_visible_fields are NULL when array_merge() is called, likely due to timing issues during plugin initialization.
    Temporary fix:
    From:
    $all_fields = array_merge( self::$fields, self::$always_visible_fields );
    to:
    $all_fields = array_merge( self::$fields ?? [], self::$always_visible_fields ?? [] );

    I have 21 sites using this plugin, and only one of them is affected.

    The hosting setup is essentially identical for these sites; the biggest difference I can think of is that the affected site uses Elementor, and the rest of them do not. Hope that’s a clue!

    Thread Starter Bhavesh Patel

    (@bhaveshnariya)

    Yes my site is also Elementor based which has fatal error issue

    Same here, Elementor

    Plugin Support Darin Kotter

    (@dkotter)

    Thanks all for the additional context. Was finally able to reproduce myself with Elementor installed so seems a conflict with that plugin (potentially other plugins as well though that’s the only one so far I’ve been able to reproduce).

    Just released v7.6.1 with a fix for this and things seem to work as expected now with Elementor installed. Let me know if anyone is still running into issues though. Thanks!

    Thread Starter Bhavesh Patel

    (@bhaveshnariya)

    Thank you for the quick resolution. It is working fine now with latest release πŸ™‚

    Thanks for the swift fix Darin, all good here now too.

    Thanks!!!

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Issue with latest plugin update’ is closed to new replies.