-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Cover Block: Prevent transform to Group block when featured image is set. #42638
Cover Block: Prevent transform to Group block when featured image is set. #42638
Conversation
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 this PR @ndiego, I think this is a good pragmatic fix for the issue described and works well for me.
I think perhaps there's a slight difference for user expectations between transforming the Cover block to Group and "grouping" a cover block, which would be good for us to explore separately (I'll add a comment on #42613).
This looks good to go to me, though!
Thanks for reviewing @andrewserong. I added an additional comment on #42613 as well. As far as this PR, I keep getting this e2e failure related to not having permissions to create Navigation Menus?! It looks like a flaky test and is not relevant to this PR. Any ideas? I can try rebasing 🤔 |
I saw quite a few test failures related to Navigation last week, and eventually re-running the tests got it passing, so my hunch is that it's unrelated to this PR, too. 🤞 re-running and/or rebasing might get them passing? |
Rerunning the tests worked, thanks @andrewserong. 🚢 ing |
I checked #40293, and it looks like the updated transform was added after WordPress 6.0 Beta 1. There is nothing to do for WordPress 6.0.2 as the code doesn't exist in the |
What?
Partially fixes #42613
Why?
Logic was added to the Cover block (#40293, #40212) that allows it to transform into a Group block in certain circumstances. While this functionality might be debatable, it's disabled when the Cover block has media applied. The original PRs did not include a check for the new Featured Image option. This PR corrects for that.
How?
We simply check if the
useFeaturedImage
attribute is set. If so, we ignore the custom Cover --> Group transform and use the default Group transform.Testing Instructions
Screenshots or screencast
Functionality prior to this PR:
Functionality after this PR: