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
Reinstate correct cover block attributes for deprecations #15449
Conversation
Thanks @gziolo. I still have the block markup, so I can add an integration test. I'll just break for some lunch and then add one. |
It would be awesome. When you have HTML markup, you just need to put it in the proper folder following the pattern used for other files. Then you run |
@gziolo I've added one for the latest deprecation, but there are a couple of older ones still. Is it worth going back through all the past deprecations for the cover block and adding those too? If so, would the idea be to add the markup to the same |
In #15268 @ellatrix suggested to include new file per deprecation entry, so let's try to do it here as well. I think, you will have to use |
a5b3f52
to
379efb0
Compare
@@ -0,0 +1,3 @@ | |||
<!-- wp:cover {"url":"https://cldup.com/uuUqE_dXzy.jpg","id":35} --> | |||
<div class="wp-block-cover has-background-dim" style="background-image:url(https://cldup.com/uuUqE_dXzy.jpg)"><p class="wp-block-cover-text"><strong>Cover Block</strong></p></div> |
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.
Can you copy one of the existing images encoded with data:*
. I think @jorgefilipecosta updated all urls to avoid network calls in tests or something like that.
@gziolo Wasn't straightforward getting markup for the older deprecations, just about managed it. I've added those fixtures the way we discussed. If another deprecation is added, all someone has to do is add a |
@@ -0,0 +1,3 @@ | |||
<!-- wp:cover {"url":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==","id":34,"className":"wp-block-cover-image"} --> |
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.
It doesn't look it gets converted properly.
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.
Managed to figure this one out as well. Had to add:
supports: {
className: false,
},
So that the change in class name from wp-block-cover-image
to wp-block-cover
works correctly.
Also added a migration function so that the inner text content is converted to a paragraph block.
@@ -0,0 +1,3 @@ | |||
<!-- wp:cover {"url":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==","id":34} --> | |||
<div class="wp-block-cover has-background-dim" style="background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==)"><div class="wp-block-cover__inner-container"></div></div> |
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.
<strong>Cover Block</strong>
is missing in the output.
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.
Now resolved by adding a migration function.
…15449) * Reinstate correct cover block attributes for deprecations * Add fixtures for deprecated cover block * Add fixtures for all deprecations of cover block * Upgrade second deprecation to migrate to inner blocks version of cover block * Fix oldest cover block deprecation
…15449) * Reinstate correct cover block attributes for deprecations * Add fixtures for deprecated cover block * Add fixtures for all deprecations of cover block * Upgrade second deprecation to migrate to inner blocks version of cover block * Fix oldest cover block deprecation
Description
Fixes #15441
The incorrect attributes were specified in the
deprecated.js
file for the cover block. It looks like the attributes for the button block were accidentally pasted into the file instead of the attributes for the cover block.How has this been tested?
Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist: