-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flex layout classes added incorrectly in deprecated gallery blocks. #48606
Comments
I can reproduce this with Gallery block deprecations 2, 4, 5 and 6. It happens because in these older Gallery versions, the block didn't have inner blocks. The layout logic is looking for the inner block wrapper, which should be the innermost block with a classname attached, and it finds the last This means it's unlikely the issue will happen with other deprecations, as afaik Gallery is the only layout-using core block that didn't start out as an inner block container. |
Backport of WordPress/gutenberg#48606, which fixes an issue found in adding fixtures for deprecated Gallery block versions in #55571. See #55571. Fixes #57831. Props isabel_brison, Mamaduka, dasnitesh780. git-svn-id: https://develop.svn.wordpress.org/trunk@55439 602fd350-edb4-49c9-b593-d223f7449a82
Backport of WordPress/gutenberg#48606, which fixes an issue found in adding fixtures for deprecated Gallery block versions in #55571. See #55571. Fixes #57831. Props isabel_brison, Mamaduka, dasnitesh780. Built from https://develop.svn.wordpress.org/trunk@55439 git-svn-id: http://core.svn.wordpress.org/trunk@54972 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Backport of WordPress/gutenberg#48606, which fixes an issue found in adding fixtures for deprecated Gallery block versions in #55571. See #55571. Fixes #57831. Props isabel_brison, Mamaduka, dasnitesh780. Built from https://develop.svn.wordpress.org/trunk@55439 git-svn-id: https://core.svn.wordpress.org/trunk@54972 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Backport of WordPress/gutenberg#48606, which fixes an issue found in adding fixtures for deprecated Gallery block versions in #55571. See #55571. Fixes #57831. Props isabel_brison, Mamaduka, dasnitesh780. Built from https://develop.svn.wordpress.org/trunk@55439 git-svn-id: http://core.svn.wordpress.org/trunk@54972 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Description
The layout parser is incorrectly adding the
is-layout-flex
classes to the deprecated gallery block formats.I have not tested other blocks (current or deprecated) but I suspect it's happening elsewhere.
A post generated from the file
/test/integration/fixtures/blocks/core__gallery__deprecated-2.html
generates markup placing theis-layout-flex
on the final image:A similar issue occurs for posts containing deprecated versions 4 and 5 of the gallery block. As above, the class is added to the final image.
As the block editor will migrate deprecated versions of the HTML when you open it, you'll need to use WP-CLI to create any posts. See the reproduction steps.
I discovered this working on adding tests for the deprecated gallery formats in WP#55571. See the PR WordPress/wordpress-develop#4140
cc @tellthemachines as discussed.
Step-by-step reproduction instructions
wp post create ./test/integration/fixtures/blocks/core__gallery__deprecated-2.html --post_title="Deprecated Gallery Format: V2" --post_status=publish
Screenshots, screen recording, code snippet
Deprecated Gallery V4
Source:
./test/integration/fixtures/blocks/core__gallery__deprecated-4.html
Result:
Deprecated Gallery V5
Source:
./test/integration/fixtures/blocks/core__gallery__deprecated-5.html
Result:
Environment info
Note: This is reproducible in WordPress Trunk both with and without the Gutenberg plugin active.
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: