Skip to content
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

Comments Block: Remove unnecessary editorStyle prop in legacy metadata #46514

Merged
merged 1 commit into from
Dec 16, 2022

Conversation

DAreRodz
Copy link
Contributor

What and why?

This PR removes an editorStyle property defined in the legacy Post Comments block's metadata.

Reasons:

  1. the property is not correctly defined; it should be editor_style instead.
  2. the property is not actually needed ―as mentioned here― because the legacy block is never rendered in the editor.

Note that nothing was going wrong from the user's perspective, so this fix could be considered a code-quality fix.

How?

Simply removing the offending line of code. 🙂

Testing Instructions

  1. Install a theme that uses the old Post Comments block (e.g., TT1 Blocks)
  2. Go to the Single template
  3. Ensure that the block being rendered is the Comments block. You can do so by either:
    3.1. checking the class used by the rendered element (it should be wp-block-comments) or
    3.2. opening the code editor (the block markup should be <!-- wp:comments {"legacy":true} /--></div>
  4. The styles used by the block come from editor.css and are applied correctly, with and without this PR.

Screenshots or screencast

This is how it should look, before and after.

Screenshot 2022-12-13 at 19 39 10

@DAreRodz DAreRodz added [Type] Code Quality Issues or PRs that relate to code quality [Block] Comments Affects the Comments Block - formerly known as Comments Query Loop [Block] Comments (legacy) The legacy mode of the Comments block (formerly known as Post Comments) labels Dec 13, 2022
Copy link
Contributor

@michalczaplinski michalczaplinski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! 👍

@DAreRodz DAreRodz linked an issue Dec 15, 2022 that may be closed by this pull request
@carolinan carolinan merged commit 0832dba into trunk Dec 16, 2022
@carolinan carolinan deleted the fix/legacy-post-comment-block-metadata branch December 16, 2022 05:24
@github-actions github-actions bot added this to the Gutenberg 14.9 milestone Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Comments (legacy) The legacy mode of the Comments block (formerly known as Post Comments) [Block] Comments Affects the Comments Block - formerly known as Comments Query Loop [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

register_legacy_post_comments_block() uses invalid metadata key
3 participants