• Resolved matte98600

    (@matte98600)


    I need help because my admin section of my site no longer works after upgrading to wordpress 5.9.1. When I try to access, in the server logs, I continuously receive the following error:

    4285#0: *878449 FastCGI sent in stderr: "l/advanced-gutenberg-main.php on line 2499PHP message: PHP Warning: in_array() expects parameter 2 to be array, null given in /var/www/vhosts/mysite.com/httpdocs/wp-content/plugins/advanced-gutenberg/incl/advanced-gutenberg-main.php on line 2500PHP message: PHP Warning: array_push() expects parameter 1 to be array, null given in /var/www/vhosts/mysite.com/httpdocs/wp-content/plugins/advanced-gutenberg/incl/advanced-gutenberg-main.php on line 2502PHP message: PHP Warning: in_array() expects parameter 2 to be array, null given in /var/www/vhosts/mysite.com/httpdocs/wp-content/plugins/advanced-gutenberg/incl/advanced-gutenberg-main.php on line 2499PHP message: PHP Warning: in_array() expects parameter 2 to be array, null given in /var/www/vhosts/mysite.com/httpdocs/wp-content/plugins/advanced-gutenberg/incl/advanced-gutenberg-main.php on line 2500PHP message: PHP Warning: array_push() expects parameter 1 to be array, null given in /var/www/vhosts/mysite.com/httpdocs/wp-content/plugins/advanced-gutenberg/incl/advanced-gutenberg-main.php on line 2502PHP message: PHP Warning: in_array() expects parameter 2 to be array, null given in /var/www/vhosts/mysite.com/httpdocs/wp-content/plugins/advanced-gutenberg/incl/advanced-gutenberg-main.php on line 2499PHP message: PHP Warning: in_array() expects parameter 2 to be array, null given in /var/www/vhosts/mysite.com/httpdocs/wp-content/plugins/advanced-gutenberg/incl/advanced-gutenberg-main.php on line 2500PHP message: PHP Warning: array_push() expects parameter 1 to be array, null given in /var/www/vhosts/mysite.com/httpdocs/wp-content/plugins/advanced-gutenberg/incl/advanced-gutenberg-main.php on line 2502PHP message: PHP Warning: in_array() expects parameter 2 to be array, null given in /var/www/vhosts/mysite.com/httpdocs/wp-content/plugins/advanced-gutenberg/incl/advanced-gutenberg-main.php on line 2499PHP message: PHP Warning: in_array() expects parameter 2

    In the log, after about 20 times, I get:

    4285#0: *878449 upstream sent too big header while reading response header from upstream

    In the end I get either the 502 error page or the 404 error page.
    The rest of the site works correctly.

    • This topic was modified 4 months ago by matte98600.
Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author htmgarcia

    (@htmgarcia)

    Hi @matte98600,
    which version of PublishPress Blocks are you using?

    Thread Starter matte98600

    (@matte98600)

    Hi @htmgarcia,
    Currently I have installed version 2.11.5

    Plugin Author htmgarcia

    (@htmgarcia)

    Try going to Blocks menu, then Block access. Just hit save and confirm if the initial error is gone.

    Thread Starter matte98600

    (@matte98600)

    I can’t enter in the plugin menu because the only way to access to the admin section is by disabling PublishPress

    Plugin Author htmgarcia

    (@htmgarcia)

    I see the line of code involved according to the warning, however a warning shouldn’t break the admin.

    Besides the warning, do you see another recent error?

    Thread Starter matte98600

    (@matte98600)

    When I try to access the admin area, in the log, about 20 warning error messages appear, then the error:

    4285#0: *878449 upstream sent too big header while reading response header from upstream

    This last error leads me to error 404 or 502.

    Log screenshot

    Plugin Author htmgarcia

    (@htmgarcia)

    We actually have a fix for the warning that points to our plugin, however will be ready for next release. In the meanwhile, are you able to apply the fix below?

    Edit the file wp-content/plugins/advanced-gutenberg/incl/advanced-gutenberg-main.php

    Replace lines 2492-2494:

    if( get_option('advgb_blocks_user_roles') ) {
        $advgb_blocks_user_roles = !empty( get_option('advgb_blocks_user_roles') ) ? get_option( 'advgb_blocks_user_roles' ) : [];
        $advgb_blocks_user_roles = array_key_exists( $current_user_role, $advgb_blocks_user_roles ) ? (array)$advgb_blocks_user_roles[$current_user_role] : [];

    With:

    $advgb_blocks_user_roles = !empty( get_option('advgb_blocks_user_roles') ) ? get_option( 'advgb_blocks_user_roles' ) : [];
    $advgb_blocks_user_roles = array_key_exists( $current_user_role, $advgb_blocks_user_roles ) ? (array)$advgb_blocks_user_roles[$current_user_role] : [];
    
    if(is_array($advgb_blocks_user_roles) && count($advgb_blocks_user_roles) > 0) {
    Thread Starter matte98600

    (@matte98600)

    I applied the fix you recommended (screenshot), but it didn’t fix the problem.

    Plugin Author htmgarcia

    (@htmgarcia)

    Do you get a different warning?

    In addition to previous changes, change lines 2499-2500:

    !in_array($one_block['name'], $advgb_blocks_user_roles['active_blocks']) &&
    !in_array($one_block['name'], $advgb_blocks_user_roles['inactive_blocks'])

    With:

    is_array($advgb_blocks_user_roles['active_blocks']) && 
    is_array($advgb_blocks_user_roles['inactive_blocks']) && 
    !in_array($one_block['name'], $advgb_blocks_user_roles['active_blocks']) && 
    !in_array($one_block['name'], $advgb_blocks_user_roles['inactive_blocks'])
    Thread Starter matte98600

    (@matte98600)

    The errors I was getting were the same as before.
    With the additional modification you suggested, everything works again now.
    Thanks!

    Plugin Author htmgarcia

    (@htmgarcia)

    Thanks for the confirmation!

Viewing 11 replies - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.