Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#53416 closed defect (bug) (fixed)

block.json without a `supports` key throws notice

Reported by: walbo's profile walbo Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.8 Priority: normal
Severity: normal Version: 5.8
Component: Editor Keywords: has-patch
Focuses: Cc:


When WordPress converts typography keys declared under supports.* to supports.typography.* is never checks if supports is defined and throws an undefined index on blocks without a supports key.

Steps to reproduce:

  • Create a block without adding supports to the block.json and register the block using register_block_type_from_metadata.

Change History (3)

This ticket was mentioned in PR #1375 on WordPress/wordpress-develop by walbo.

3 years ago

  • Keywords has-patch added

#2 @SergeyBiryukov
3 years ago

  • Milestone changed from Awaiting Review to 5.8

#3 @SergeyBiryukov
3 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 51167:

Editor: Check if supports metadata key is defined before migrating typography keys.

This avoids an "Undefined index" PHP notice on blocks without a supports key in block.json.

Follow-up to [51089], [51153], [51159].

Props walbo.
Fixes #53416.

Note: See TracTickets for help on using tickets.