Make WordPress Core

Changes between Initial Version and Version 2 of Ticket #59968


Ignore:
Timestamp:
11/28/2023 03:31:45 PM (6 months ago)
Author:
sabernhardt
Comment:

Somehow the $block_attributes variable is null in wp_apply_alignment_support() for your site, and the stack trace mentions the Site Logo block.

Line 48 could check is_array() before running array_key_exists(), but it would help to know how the $block_attributes can be any other type.

$has_block_alignment = is_array( $block_attributes ) && array_key_exists( 'align', $block_attributes );

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #59968 – Description

    initial v2  
    443- Visit the home page => fatal error is there
    55
     6`[27-Nov-2023 09:57:34 UTC] PHP Fatal error:  Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, null given in /.../wp-includes/block-supports/align.php:48`
    67
    78{{{
    8 [27-Nov-2023 09:57:34 UTC] PHP Fatal error:  Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, null given in /var/www/new.rocketlabsqa.ovh/htdocs/wp-includes/block-supports/align.php:48
    99Stack trace:
    10 #0 /var/www/new.rocketlabsqa.ovh/htdocs/wp-includes/class-wp-block-supports.php(119): wp_apply_alignment_support()
    11 #1 /var/www/new.rocketlabsqa.ovh/htdocs/wp-includes/class-wp-block-supports.php(176): WP_Block_Supports->apply_block_supports()
    12 #2 /var/www/new.rocketlabsqa.ovh/htdocs/wp-includes/blocks/site-logo.php(56): get_block_wrapper_attributes()
    13 #3 /var/www/new.rocketlabsqa.ovh/htdocs/wp-includes/class-wp-block.php(258): render_block_core_site_logo()
    14 #4 /var/www/new.rocketlabsqa.ovh/htdocs/wp-includes/class-wp-block.php(244): WP_Block->render()
    15 #5 /var/www/new.rocketlabsqa.ovh/htdocs/wp-includes/class-wp-block.php(244): WP_Block->render()
    16 #6 /var/www/new.rocketlabsqa.ovh/htdocs/wp-includes/class-wp-block.php(244): WP_Block->render()
    17 #7 /var/www/new.rocketlabsqa.ovh/htdocs/wp-includes/blocks.php(1484): WP_Block->render()
    18 #8 /var/www/new.rocketlabsqa.ovh/htdocs/wp-includes/blocks.php(1522): render_block()
    19 #9 /var/www/new.rocketlabsqa.ovh/htdocs/wp-includes/blocks/template-part.php(144): do_blocks()
    20 #10 /var/www/new.rocketlabsqa.ovh/htdocs/wp-includes/class-wp-block.php(258): render_block_core_template_part()
    21 #11 /var/www/new.rocketlabsqa.ovh/htdocs/wp-includes/blocks.php(1484): WP_Block->render()
    22 #12 /var/www/new.rocketlabsqa.ovh/htdocs/wp-includes/blocks.php(1522): render_block()
    23 #13 /var/www/new.rocketlabsqa.ovh/htdocs/wp-includes/block-template.php(260): do_blocks()
    24 #14 /var/www/new.rocketlabsqa.ovh/htdocs/wp-includes/template-canvas.php(12): get_the_block_template_html()
    25 #15 /var/www/new.rocketlabsqa.ovh/htdocs/wp-includes/template-loader.php(106): include('...')
    26 #16 /var/www/new.rocketlabsqa.ovh/htdocs/wp-blog-header.php(19): require_once('...')
    27 #17 /var/www/new.rocketlabsqa.ovh/htdocs/index.php(17): require('...')
     10#0 /.../wp-includes/class-wp-block-supports.php(119): wp_apply_alignment_support()
     11#1 /.../wp-includes/class-wp-block-supports.php(176): WP_Block_Supports->apply_block_supports()
     12#2 /.../wp-includes/blocks/site-logo.php(56): get_block_wrapper_attributes()
     13#3 /.../wp-includes/class-wp-block.php(258): render_block_core_site_logo()
     14#4 /.../wp-includes/class-wp-block.php(244): WP_Block->render()
     15#5 /.../wp-includes/class-wp-block.php(244): WP_Block->render()
     16#6 /.../wp-includes/class-wp-block.php(244): WP_Block->render()
     17#7 /.../wp-includes/blocks.php(1484): WP_Block->render()
     18#8 /.../wp-includes/blocks.php(1522): render_block()
     19#9 /.../wp-includes/blocks/template-part.php(144): do_blocks()
     20#10 /.../wp-includes/class-wp-block.php(258): render_block_core_template_part()
     21#11 /.../wp-includes/blocks.php(1484): WP_Block->render()
     22#12 /.../wp-includes/blocks.php(1522): render_block()
     23#13 /.../wp-includes/block-template.php(260): do_blocks()
     24#14 /.../wp-includes/template-canvas.php(12): get_the_block_template_html()
     25#15 /.../wp-includes/template-loader.php(106): include('...')
     26#16 /.../wp-blog-header.php(19): require_once('...')
     27#17 /.../index.php(17): require('...')
    2828#18 {main}
    29   thrown in /var/www/new.rocketlabsqa.ovh/htdocs/wp-includes/block-supports/align.php on line 48
     29  thrown in /.../wp-includes/block-supports/align.php on line 48
    3030}}}
    3131