[wp-trac] [WordPress Trac] #56799: PHP notice in class-wp-block-supports.php

WordPress Trac noreply at wordpress.org
Tue Oct 11 17:40:27 UTC 2022


#56799: PHP notice in class-wp-block-supports.php
--------------------------+-----------------------------
 Reporter:  petitphp      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 On Core trunk with the TwentyTwentyThree theme with debug mode, a notice
 is visible on the frontend :

 {{{
  Notice: Undefined index: attrs in /var/www/src/wp-includes/class-wp-
 block-supports.php on line 97
 }}}

 This come from the `WP_Block_Supports::apply_block_supports` method which
 expect the block data to contain an `attrs` key :

 {{{
 public function apply_block_supports() {
     $block_attributes = self::$block_to_render['attrs'];
     $block_type       =
 WP_Block_Type_Registry::get_instance()->get_registered(
                         self::$block_to_render['blockName']
     );
     ...
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56799>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list