bobbingwide / fizzie

Fizzie theme - a Full Site Editing theme using Gutenberg blocks
9 stars 1 forks source link

Fatal errror: Uncaught TypeError: array_key_exists() #82

Closed bobbingwide closed 1 year ago

bobbingwide commented 1 year ago

This is happening a lot in woocommerce.wp-a2z.org. The debug log was over 900 MB.

[16-Sep-2022 14:37:22 UTC] PHP Fatal error: Uncaught TypeError: array_key_exists(): Argument bobbingwide/wizzie#2 ($array) must be of type array, null given in /home/customer/www/bobbingwide.org.uk/public_html/wp-includes/block-supports/align.php:48 Stack trace:

#0 /home/customer/www/bobbingwide.org.uk/public_html/wp-includes/class-wp-block-supports.php(113): wp_apply_alignment_support(Object(WP_Block_Type), NULL)
bobbingwide/wizzie#1 /home/customer/www/bobbingwide.org.uk/public_html/wp-includes/class-wp-block-supports.php(170): WP_Block_Supports->apply_block_supports()
bobbingwide/wizzie#2 /home/customer/www/bobbingwide.org.uk/public_html/wp-content/themes/wizzie/includes/template-part.php(150): get_block_wrapper_attributes()
bobbingwide/wizzie#3 /home/customer/www/bobbingwide.org.uk/public_html/wp-includes/class-wp-block.php(255): wizzie_render_block_core_template_part(Array, '', Object(WP_Block))
bobbingwide/wizzie#4 /home/customer/www/bobbingwide.org.uk/public_html/wp-includes/class-wp-block.php(241): WP_Block->render()
bobbingwide/wizzie#5 /home/customer/www/bobbingwide.org.uk/public_html/wp-includes/blocks.php(902): WP_Block->render()
bobbingwide/wizzie#6 /home/customer/www/bobbingwide.org.uk/public_html/wp-includes/blocks.php(940): render_block(Array)
bobbingwide/wizzie#7 /home/customer/www/bobbingwide.org.uk/public_html/wp-content/themes/wizzie/includes/template-part.php(122): do_blocks('<!-- wp:group {...')
bobbingwide/wizzie#8 /home/customer/www/bobbingwide.org.uk/public_html/wp-includes/class-wp-block.php(255): wizzie_render_block_core_template_part(Array, '<!-- wp:group {...', Object(WP_Block))
bobbingwide/wizzie#9 /home/customer/www/bobbingwide.org.uk/public_html/wp-includes/blocks.php(902): WP_Block->render()
bobbingwide/wizzie#10 /home/customer/www/bobbingwide.org.uk/public_html/wp-includes/blocks.php(940): render_block(Array)
bobbingwide/wizzie#11 /home/customer/www/bobbingwide.org.uk/public_html/wp-includes/block-template.php(240): do_blocks('<!-- wp:html --...')
bobbingwide/fizzie#82 /home/customer/www/bobbingwide.org.uk/public_html/wp-includes/template-canvas.php(12): get_the_block_template_html()
#13 /home/customer/www/bobbingwide.org.uk/public_html/wp-includes/template-loader.php(106): include('/home/customer/...')
#14 /home/customer/www/bobbingwide.org.uk/public_html/wp-blog-header.php(19): require_once('/home/customer/...')
#15 /home/customer/www/bobbingwide.org.uk/public_html/index.php(17): require('/home/customer/...')
#16 {main}
  thrown in /home/customer/www/bobbingwide.org.uk/public_html/wp-includes/block-supports/align.php on line 48
bobbingwide commented 1 year ago

It's still happening. It occurs when visiting woocommerce.wp-a2z.org when not logged in. I thought this could be a caching issue. But purging the cache using SiteGround optimizer didn't resolve the problem. I've reproduced the problem locally.

Workaround

bobbingwide commented 1 year ago

The template part it's failing on is the incorrectly coded tag inside Fizzie's footer.html

<!-- wp:template-part { "slug": "social-links" "align":"wide" } /-->

there's a comma missing between the attributes.

The strange thing is that it appears to work with the Fizzie theme, although we don't see the social links.

bobbingwide commented 1 year ago

delivered in v1.2.0