Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#60292 closed defect (bug) (fixed)

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

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

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.


3 years 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
3 years ago

  • Owner set to isabel_brison
  • Resolution → fixed
  • Status new → 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:


3 years ago
#3

Committed in r57328.

​@andrewserong commented on ​PR #5900:


3 years ago
#4

Thanks for reviewing and committing!

Note: See TracTickets for help on using tickets.