Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#53416 closed defect (bug) (fixed)

block.json without a `supports` key throws notice

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

Description

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.


5 years ago
#1

  • Keywords has-patch added

#2 @SergeyBiryukov
5 years ago

  • Milestone Awaiting Review5.8

#3 @SergeyBiryukov
5 years ago

  • Owner set to SergeyBiryukov
  • Resolutionfixed
  • Status newclosed

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.