• Resolved Pinf s.r.o.

    (@pinfsro)


    Hi, I’m getting some errors with PHP 8 on my website (WP 5.8.3) in Customizer and in “Legacy Widgets”. Would it be possible to fix this? Maybe just an if with “is_array()”?

    Warning: in_array() expects parameter 2 to be array, null given in /…/wp-content/plugins/advanced-gutenberg/init.php on line 109

    Warning: in_array() expects parameter 2 to be array, null given in /…/wp-content/plugins/advanced-gutenberg/init.php on line 110

    Warning: array_push() expects parameter 1 to be array, null given in /…/wp-content/plugins/advanced-gutenberg/init.php on line 116

    • This topic was modified 2 years, 10 months ago by Pinf s.r.o.. Reason: accidentally submitted before finished writing
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author htmgarcia

    (@htmgarcia)

    Hi @pinfsro,

    1. Which version of PublishPress Blocks are you using?
    2. Go to Blocks menu, then Block Access. Click save Block Access for Administrator user role. See if the warning is gone.

    Thread Starter Pinf s.r.o.

    (@pinfsro)

    Version is 2.11.3, sorry for not including this.
    Yes, this did help, warning is gone. Thank you.

    Plugin Author htmgarcia

    (@htmgarcia)

    We appreciate your feedback!

    Just want to say that I was getting a fatal error trying to activate the customizer with PHP 8 running plugin version 2.11.4 on WordPress 5.9 on WP Engine. I even disabled every plugin but PublishPress Blocks and activated the default theme, and still had the fatal error.

    So I rolled back to PHP 7.4, and tried what was recommended above. I went to Blocks –> Block Access, clicked the Save Block Access button, and the issue was sorted. When I switched back to PHP 8, the error was gone. So glad I found this thread!!

    Plugin Author htmgarcia

    (@htmgarcia)

    Hi @chriscree,
    I’m glad this thread was helpful!

    If by chance you have the full details to reproduce the issue, we would appreciate it.

    Regards

    Basically any site that I had running PublishPress Blocks would crash with the below fatal error when I attempted to go into the Customizer. I suspect it was because I never set any Block Permissions in the settings and there was a null value for the $advgb_blocks_user_roles array. I don’t know if you can have the plugin set a default Block Permission that can be changed via the settings to avoid the error?

    Anyway, here is the error I got when I set wp_debug to true:

    Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in /nas/content/live/sitename/wp-content/plugins/advanced-gutenberg/incl/advanced-gutenberg-main.php:2480 Stack trace: #0 /nas/content/live/sitename/wp-content/plugins/advanced-gutenberg/incl/advanced-gutenberg-main.php(2480): in_array(‘genesis-page-bu…’, NULL) #1 /nas/content/live/sitename/wp-content/plugins/advanced-gutenberg/incl/advanced-gutenberg-main.php(516): AdvancedGutenbergMain->getUserBlocksForGutenberg() #2 /nas/content/live/sitename/wp-content/plugins/advanced-gutenberg/incl/advanced-gutenberg-main.php(422): AdvancedGutenbergMain->advgbBlocksVariables(false) #3 /nas/content/live/sitename/wp-includes/class-wp-hook.php(307): AdvancedGutenbergMain->addEditorAssetsWidgets(‘widgets.php’) #4 /nas/content/live/sitename/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array) #5 /nas/content/live/sitename/wp-includes/plugin.php(474): WP_Hook->do_action(Array) #6 /nas/content/live/sitename/wp-includes/class-wp-customize-widgets.php(704): do_action(‘admin_enqueue_s…’, ‘widgets.php’) #7 /nas/content/live/sitename/wp-includes/class-wp-hook.php(307): WP_Customize_Widgets->enqueue_scripts(”) #8 /nas/content/live/sitename/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array) #9 /nas/content/live/sitename/wp-includes/plugin.php(474): WP_Hook->do_action(Array) #10 /nas/content/live/sitename/wp-admin/customize.php(123): do_action(‘customize_contr…’) #11 {main} thrown in /nas/content/live/sitename/wp-content/plugins/advanced-gutenberg/incl/advanced-gutenberg-main.php on line 2480

    Hopefully that helps some.

    Plugin Author htmgarcia

    (@htmgarcia)

    Thanks, @chriscree !

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘PHP Warnings in Customizer page’ is closed to new replies.