-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Table Block: Add a deprecation for the figcaption element class name #45161
Conversation
Size Change: +294 B (0%) Total Size: 1.28 MB
ℹ️ View Unchanged
|
source: 'attribute', | ||
attribute: 'data-align', | ||
}, | ||
const v3 = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for restructuring this into a named version format - it makes it much easier to work with the deprecations this way. It would be good to add a comment above the v3 to outline the reason for the deprecation:
// In #41140 support was added to global styles for caption elements which added a `wp-element-caption` classname to the embed figcaption element.
this hasn't been common practice in the past, but it helps when looking at deprecations at a glance to work out what they cover.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your review, done!
It would be good to add a new fixture here for the v3 deprecation - happy to help with adding that if you are not familiar with those fixtures. |
I ran |
You will need to add a new fixture file called `core__table__deprecated-3.html with the content:
which represents a table with a caption before |
Thank you! I checked again and found that the file already existed: This appears to have been generated as soon as #41140 supported wp-element-caption. |
This file represents the current version of the block rather than the previous deprecated version, so there needs to be a |
I ran out of time to give this a final test, sorry, hopefully someone else will pick it up soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is testing well for me.
Testing well here too. Thanks! I will merge it. |
Thanks everyone for the reviews! |
…45161) * Table Block: fix table deprecation * Add comment * Add new fixture for the v3 deprecation Co-authored-by: Glen Davies <[email protected]>
I just cherry-picked this PR to the wp/6.1 branch to get it included in the next release: 490c14b |
Package updates for bug and regression fixes: - @wordpress/block-directory: 3.15.10 - @wordpress/block-editor: 10.0.9 - @wordpress/block-library: 7.14.10 - @wordpress/customize-widgets: 3.14.10 - @wordpress/edit-post: 6.14.10 - @wordpress/edit-site: 4.14.12 - @wordpress/edit-widgets: 4.14.10 - @wordpress/editor: 12.16.9 - @wordpress/format-library: 3.15.9 - @wordpress/reusable-blocks: 3.15.9 - @wordpress/widgets: 2.15.9 Original PRs from Gutenberg repository: * [WordPress/gutenberg#45189 Gutenberg PR 45189] - Fix resizeable editor scrolling * [WordPress/gutenberg#45234 Gutenberg PR 45234] - Reset background-image property for outline button style * [WordPress/gutenberg#45161 Gutenberg PR 45161] - Table Block: Add a deprecation for the figcaption element class name * [WordPress/gutenberg#45159 Gutenberg PR 45159] - File Block: Add a deprecation for the button element class name * [WordPress/gutenberg#45169 Gutenberg PR 45169] - Video: Add a deprecation for the caption element * [WordPress/gutenberg#45166 Gutenberg PR 45166] - Embed: Add deprecation for the caption element * [WordPress/gutenberg#45173 Gutenberg PR 45173] - Gallery: Add a deprecation for captions in the gallery block * [WordPress/gutenberg#44854 Gutenberg PR 44854] - Embed Block: Add support for Tumblr Dashboard URLs * [WordPress/gutenberg#45074 Gutenberg PR 45074] - Post editor: Rename view to Preview * [WordPress/gutenberg#45163 Gutenberg PR 45163] - Featured Image Block: Add missing output escaping * [WordPress/gutenberg#45118 Gutenberg PR 45118] - [WP6.1] Site editor clips body background style Follow-up to [54257], [54335], [54383], [54483], [54486], [54490], and [54632]. Props czapla, cbravobernal, ndiego, annezazu, davidbaumwald, desrosj, mikeschroder, hellofromtonya, ocean90. See #56467. Built from https://develop.svn.wordpress.org/trunk@54693 git-svn-id: http://core.svn.wordpress.org/trunk@54245 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Package updates for bug and regression fixes: - @wordpress/block-directory: 3.15.10 - @wordpress/block-editor: 10.0.9 - @wordpress/block-library: 7.14.10 - @wordpress/customize-widgets: 3.14.10 - @wordpress/edit-post: 6.14.10 - @wordpress/edit-site: 4.14.12 - @wordpress/edit-widgets: 4.14.10 - @wordpress/editor: 12.16.9 - @wordpress/format-library: 3.15.9 - @wordpress/reusable-blocks: 3.15.9 - @wordpress/widgets: 2.15.9 Original PRs from Gutenberg repository: * [WordPress/gutenberg#45189 Gutenberg PR 45189] - Fix resizeable editor scrolling * [WordPress/gutenberg#45234 Gutenberg PR 45234] - Reset background-image property for outline button style * [WordPress/gutenberg#45161 Gutenberg PR 45161] - Table Block: Add a deprecation for the figcaption element class name * [WordPress/gutenberg#45159 Gutenberg PR 45159] - File Block: Add a deprecation for the button element class name * [WordPress/gutenberg#45169 Gutenberg PR 45169] - Video: Add a deprecation for the caption element * [WordPress/gutenberg#45166 Gutenberg PR 45166] - Embed: Add deprecation for the caption element * [WordPress/gutenberg#45173 Gutenberg PR 45173] - Gallery: Add a deprecation for captions in the gallery block * [WordPress/gutenberg#44854 Gutenberg PR 44854] - Embed Block: Add support for Tumblr Dashboard URLs * [WordPress/gutenberg#45074 Gutenberg PR 45074] - Post editor: Rename view to Preview * [WordPress/gutenberg#45163 Gutenberg PR 45163] - Featured Image Block: Add missing output escaping * [WordPress/gutenberg#45118 Gutenberg PR 45118] - [WP6.1] Site editor clips body background style Follow-up to [54257], [54335], [54383], [54483], [54486], [54490], and [54632]. Props czapla, cbravobernal, ndiego, annezazu, davidbaumwald, desrosj, mikeschroder, hellofromtonya, ocean90. See #56467. Built from https://develop.svn.wordpress.org/trunk@54693 git-svn-id: https://core.svn.wordpress.org/trunk@54245 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Package updates for bug and regression fixes since 6.1 RC 2: - @wordpress/block-directory: 3.15.10 - @wordpress/block-editor: 10.0.9 - @wordpress/block-library: 7.14.10 - @wordpress/customize-widgets: 3.14.10 - @wordpress/edit-post: 6.14.10 - @wordpress/edit-site: 4.14.12 - @wordpress/edit-widgets: 4.14.10 - @wordpress/editor: 12.16.9 - @wordpress/format-library: 3.15.9 - @wordpress/reusable-blocks: 3.15.9 - @wordpress/widgets: 2.15.9 Original PRs from Gutenberg repository: * [WordPress/gutenberg#45189 Gutenberg PR 45189] - Fix resizeable editor scrolling * [WordPress/gutenberg#45234 Gutenberg PR 45234] - Reset background-image property for outline button style * [WordPress/gutenberg#45161 Gutenberg PR 45161] - Table Block: Add a deprecation for the figcaption element class name * [WordPress/gutenberg#45159 Gutenberg PR 45159] - File Block: Add a deprecation for the button element class name * [WordPress/gutenberg#45169 Gutenberg PR 45169] - Video: Add a deprecation for the caption element * [WordPress/gutenberg#45166 Gutenberg PR 45166] - Embed: Add deprecation for the caption element * [WordPress/gutenberg#45173 Gutenberg PR 45173] - Gallery: Add a deprecation for captions in the gallery block * [WordPress/gutenberg#44854 Gutenberg PR 44854] - Embed Block: Add support for Tumblr Dashboard URLs * [WordPress/gutenberg#45074 Gutenberg PR 45074] - Post editor: Rename view to Preview * [WordPress/gutenberg#45163 Gutenberg PR 45163] - Featured Image Block: Add missing output escaping * [WordPress/gutenberg#45118 Gutenberg PR 45118] - [WP6.1] Site editor clips body background style Follow-up to [54257], [54335], [54383], [54483], [54486], [54490], and [54632]. Props czapla, cbravobernal, ndiego, annezazu, davidbaumwald, desrosj, mikeschroder, hellofromtonya, ocean90. Reviewed by desrosj, hellofromTonya, SergeyBiryukov. Merges [54693] to the 6.1 branch. See #56467. git-svn-id: https://develop.svn.wordpress.org/branches/6.1@54694 602fd350-edb4-49c9-b593-d223f7449a82
Package updates for bug and regression fixes since 6.1 RC 2: - @wordpress/block-directory: 3.15.10 - @wordpress/block-editor: 10.0.9 - @wordpress/block-library: 7.14.10 - @wordpress/customize-widgets: 3.14.10 - @wordpress/edit-post: 6.14.10 - @wordpress/edit-site: 4.14.12 - @wordpress/edit-widgets: 4.14.10 - @wordpress/editor: 12.16.9 - @wordpress/format-library: 3.15.9 - @wordpress/reusable-blocks: 3.15.9 - @wordpress/widgets: 2.15.9 Original PRs from Gutenberg repository: * [WordPress/gutenberg#45189 Gutenberg PR 45189] - Fix resizeable editor scrolling * [WordPress/gutenberg#45234 Gutenberg PR 45234] - Reset background-image property for outline button style * [WordPress/gutenberg#45161 Gutenberg PR 45161] - Table Block: Add a deprecation for the figcaption element class name * [WordPress/gutenberg#45159 Gutenberg PR 45159] - File Block: Add a deprecation for the button element class name * [WordPress/gutenberg#45169 Gutenberg PR 45169] - Video: Add a deprecation for the caption element * [WordPress/gutenberg#45166 Gutenberg PR 45166] - Embed: Add deprecation for the caption element * [WordPress/gutenberg#45173 Gutenberg PR 45173] - Gallery: Add a deprecation for captions in the gallery block * [WordPress/gutenberg#44854 Gutenberg PR 44854] - Embed Block: Add support for Tumblr Dashboard URLs * [WordPress/gutenberg#45074 Gutenberg PR 45074] - Post editor: Rename view to Preview * [WordPress/gutenberg#45163 Gutenberg PR 45163] - Featured Image Block: Add missing output escaping * [WordPress/gutenberg#45118 Gutenberg PR 45118] - [WP6.1] Site editor clips body background style Follow-up to [54257], [54335], [54383], [54483], [54486], [54490], and [54632]. Props czapla, cbravobernal, ndiego, annezazu, davidbaumwald, desrosj, mikeschroder, hellofromtonya, ocean90. Reviewed by desrosj, hellofromTonya, SergeyBiryukov. Merges [54693] to the 6.1 branch. See #56467. Built from https://develop.svn.wordpress.org/branches/6.1@54694 git-svn-id: http://core.svn.wordpress.org/branches/6.1@54246 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Package updates for bug and regression fixes: - @wordpress/block-directory: 3.15.10 - @wordpress/block-editor: 10.0.9 - @wordpress/block-library: 7.14.10 - @wordpress/customize-widgets: 3.14.10 - @wordpress/edit-post: 6.14.10 - @wordpress/edit-site: 4.14.12 - @wordpress/edit-widgets: 4.14.10 - @wordpress/editor: 12.16.9 - @wordpress/format-library: 3.15.9 - @wordpress/reusable-blocks: 3.15.9 - @wordpress/widgets: 2.15.9 Original PRs from Gutenberg repository: * [WordPress/gutenberg#45189 Gutenberg PR 45189] - Fix resizeable editor scrolling * [WordPress/gutenberg#45234 Gutenberg PR 45234] - Reset background-image property for outline button style * [WordPress/gutenberg#45161 Gutenberg PR 45161] - Table Block: Add a deprecation for the figcaption element class name * [WordPress/gutenberg#45159 Gutenberg PR 45159] - File Block: Add a deprecation for the button element class name * [WordPress/gutenberg#45169 Gutenberg PR 45169] - Video: Add a deprecation for the caption element * [WordPress/gutenberg#45166 Gutenberg PR 45166] - Embed: Add deprecation for the caption element * [WordPress/gutenberg#45173 Gutenberg PR 45173] - Gallery: Add a deprecation for captions in the gallery block * [WordPress/gutenberg#44854 Gutenberg PR 44854] - Embed Block: Add support for Tumblr Dashboard URLs * [WordPress/gutenberg#45074 Gutenberg PR 45074] - Post editor: Rename view to Preview * [WordPress/gutenberg#45163 Gutenberg PR 45163] - Featured Image Block: Add missing output escaping * [WordPress/gutenberg#45118 Gutenberg PR 45118] - [WP6.1] Site editor clips body background style Follow-up to [54257], [54335], [54383], [54483], [54486], [54490], and [54632]. Props czapla, cbravobernal, ndiego, annezazu, davidbaumwald, desrosj, mikeschroder, hellofromtonya, ocean90. See #56467. git-svn-id: https://develop.svn.wordpress.org/trunk@54693 602fd350-edb4-49c9-b593-d223f7449a82
Package updates for bug and regression fixes: - @wordpress/block-directory: 3.15.10 - @wordpress/block-editor: 10.0.9 - @wordpress/block-library: 7.14.10 - @wordpress/customize-widgets: 3.14.10 - @wordpress/edit-post: 6.14.10 - @wordpress/edit-site: 4.14.12 - @wordpress/edit-widgets: 4.14.10 - @wordpress/editor: 12.16.9 - @wordpress/format-library: 3.15.9 - @wordpress/reusable-blocks: 3.15.9 - @wordpress/widgets: 2.15.9 Original PRs from Gutenberg repository: * [WordPress/gutenberg#45189 Gutenberg PR 45189] - Fix resizeable editor scrolling * [WordPress/gutenberg#45234 Gutenberg PR 45234] - Reset background-image property for outline button style * [WordPress/gutenberg#45161 Gutenberg PR 45161] - Table Block: Add a deprecation for the figcaption element class name * [WordPress/gutenberg#45159 Gutenberg PR 45159] - File Block: Add a deprecation for the button element class name * [WordPress/gutenberg#45169 Gutenberg PR 45169] - Video: Add a deprecation for the caption element * [WordPress/gutenberg#45166 Gutenberg PR 45166] - Embed: Add deprecation for the caption element * [WordPress/gutenberg#45173 Gutenberg PR 45173] - Gallery: Add a deprecation for captions in the gallery block * [WordPress/gutenberg#44854 Gutenberg PR 44854] - Embed Block: Add support for Tumblr Dashboard URLs * [WordPress/gutenberg#45074 Gutenberg PR 45074] - Post editor: Rename view to Preview * [WordPress/gutenberg#45163 Gutenberg PR 45163] - Featured Image Block: Add missing output escaping * [WordPress/gutenberg#45118 Gutenberg PR 45118] - [WP6.1] Site editor clips body background style Follow-up to [54257], [54335], [54383], [54483], [54486], [54490], and [54632]. Props czapla, cbravobernal, ndiego, annezazu, davidbaumwald, desrosj, mikeschroder, hellofromtonya, ocean90. See #56467. Built from https://develop.svn.wordpress.org/trunk@54693 git-svn-id: http://core.svn.wordpress.org/trunk@54245 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Package updates for bug and regression fixes since 6.1 RC 2: - @wordpress/block-directory: 3.15.10 - @wordpress/block-editor: 10.0.9 - @wordpress/block-library: 7.14.10 - @wordpress/customize-widgets: 3.14.10 - @wordpress/edit-post: 6.14.10 - @wordpress/edit-site: 4.14.12 - @wordpress/edit-widgets: 4.14.10 - @wordpress/editor: 12.16.9 - @wordpress/format-library: 3.15.9 - @wordpress/reusable-blocks: 3.15.9 - @wordpress/widgets: 2.15.9 Original PRs from Gutenberg repository: * [WordPress/gutenberg#45189 Gutenberg PR 45189] - Fix resizeable editor scrolling * [WordPress/gutenberg#45234 Gutenberg PR 45234] - Reset background-image property for outline button style * [WordPress/gutenberg#45161 Gutenberg PR 45161] - Table Block: Add a deprecation for the figcaption element class name * [WordPress/gutenberg#45159 Gutenberg PR 45159] - File Block: Add a deprecation for the button element class name * [WordPress/gutenberg#45169 Gutenberg PR 45169] - Video: Add a deprecation for the caption element * [WordPress/gutenberg#45166 Gutenberg PR 45166] - Embed: Add deprecation for the caption element * [WordPress/gutenberg#45173 Gutenberg PR 45173] - Gallery: Add a deprecation for captions in the gallery block * [WordPress/gutenberg#44854 Gutenberg PR 44854] - Embed Block: Add support for Tumblr Dashboard URLs * [WordPress/gutenberg#45074 Gutenberg PR 45074] - Post editor: Rename view to Preview * [WordPress/gutenberg#45163 Gutenberg PR 45163] - Featured Image Block: Add missing output escaping * [WordPress/gutenberg#45118 Gutenberg PR 45118] - [WP6.1] Site editor clips body background style Follow-up to [54257], [54335], [54383], [54483], [54486], [54490], and [54632]. Props czapla, cbravobernal, ndiego, annezazu, davidbaumwald, desrosj, mikeschroder, hellofromtonya, ocean90. Reviewed by desrosj, hellofromTonya, SergeyBiryukov. Merges [54693] to the 6.1 branch. See #56467. Built from https://develop.svn.wordpress.org/branches/6.1@54694 git-svn-id: http://core.svn.wordpress.org/branches/6.1@54246 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Part of #45153
What?
This PR fixes a problem with broken the table block when updating from WordPress 6.0 to 6.1. Adds a deprecation for the Table block figcaption element class name.
Why?
The
wp-element-caption
class has been added to thefigcaption
element by #41239. So if the table has caption text, the block may be broken by updating to 6.1.If the table does not have a color, the existing migration will not break the block. However, if some style is added by block support, the block should be broken because it does not meet the conditions of the existing migration.
How?
I have split the existing depreciation into v1 and v2 and added a new v3. The newly added v3 is the definition before #41239 was done.
I also believe that the fixture is not regenerated because table blocks don't have captions by default.
Testing Instructions
Below is a markup variation of the table created in WordPress6.0. Paste into WordPress 6.1 content with the Gutenberg plugin enabled, and confirm that the block is broken or causes unintended behavior. The actual behavior can be seen in the video of this comment.
Then, confirm that this PR won't break the blocks and the expected results are obtained in all variations.
With text color and caption text
The block will be broken.
HTML
With custom text color and caption text
The block will be broken.
HTML
With background color and caption text
The block will lose background color.
HTML
With custom background color and caption text
The block will be broken.
HTML