Make WordPress Core

Opened 8 months ago

Closed 8 months ago

Last modified 8 months ago

#59358 closed defect (bug) (fixed)

Fix post editor layout when Post Content block attributes are empty

Reported by: isabel_brison's profile isabel_brison Owned by: isabel_brison's profile isabel_brison
Milestone: 6.4 Priority: normal
Severity: normal Version: 6.4
Component: Editor Keywords: gutenberg-merge has-patch has-unit-tests
Focuses: Cc:

Description

Currently we only set $post_content_block_attributes in the editor settings if the post content attributes array isn't empty. But if the block's layout settings aren't changed, the attributes array may well be empty, which results in the wrong layout in the post editor.

This ticket tracks syncing this Gutenberg fix: https://github.com/WordPress/gutenberg/pull/54485

Change History (3)

This ticket was mentioned in PR #5221 on WordPress/wordpress-develop by @isabel_brison.


8 months ago
#1

  • Keywords has-patch has-unit-tests added

Trac ticket: https://core.trac.wordpress.org/ticket/59358

This PR syncs the changes from https://github.com/WordPress/gutenberg/pull/54485 and adds a test for the Post Content block with empty attributes.

#2 @isabel_brison
8 months ago

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

In 56629:

Editor: Fix post editor layout when Post Content has no attributes.

Changes output of wp_get_post_content_block_attributes to return null if Post Content block doesn’t exist or empty array if it has no attributes.

Props flixos90, mukesh27.
Fixes #59358.

@isabel_brison commented on PR #5221:


8 months ago
#3

Thanks for the reviews! Committed in r56629.

Note: See TracTickets for help on using tickets.