Make WordPress Core

Opened 12 months ago

Closed 12 months ago

Last modified 12 months ago

#60292 closed defect (bug) (fixed)

Layout: backport fix to ensure blocks without layout support do not receive layout classnames

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

Description

This ticket is to track backporting a fix from the Gutenberg repo, which landed in https://github.com/WordPress/gutenberg/pull/56187 :

Prevent layout classnames from being output on blocks where there is no layout support and child layout classnames are not being output. An example is a paragraph that is a child of a group block, and that has selfStretch set to fit. In this case, no layout classnames should be added to the paragraph block, but prior to https://github.com/WordPress/gutenberg/pull/56187 they were being added unexpectedly.

Change History (4)

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


12 months ago
#1

  • Keywords has-patch has-unit-tests added

Backport changes from the Gutenberg plugin in: https://github.com/WordPress/gutenberg/pull/56187

Prevent layout classnames from being output on blocks where there is no layout support _and_ child layout classnames are not being output. An example is a paragraph that is a child of a group block, and that has selfStretch set to fit. In this case, no layout classnames should be added to the paragraph block, but prior to https://github.com/WordPress/gutenberg/pull/56187 they were being added unexpectedly.

This PR also adds a test to cover the fix. For further context and sample test markup, see the PR description of https://github.com/WordPress/gutenberg/pull/56187

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

#2 @isabel_brison
12 months ago

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

In 57328:

Editor: fix classname output on blocks without layout.

Prevents layout classnames from being output on blocks with no layout support and no child layout classnames by returning early from wp_render_layout_support_flag.

Props andrewserong.
Fixes #60292.

@isabel_brison commented on PR #5900:


12 months ago
#3

Committed in r57328.

@andrewserong commented on PR #5900:


12 months ago
#4

Thanks for reviewing and committing!

Note: See TracTickets for help on using tickets.