-
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
Block Hooks: Fix duplicated insertion in Post Content #69142
Block Hooks: Fix duplicated insertion in Post Content #69142
Conversation
6e27775
to
9750de5
Compare
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
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 looks good to go. Apologies for all accidental pings. I wanted to test the changes with new e2e tests by pointing the base branch to the other PR 😅
What?
In the editor, hooked blocks are currently inserted twice into post content (when using the GB plugin on a WP
trunk
install).This was likely introduced by #67272 and its Core counterpart,
[59523]
. It was probably not discovered earlier as it requires testing GB against Coretrunk
.Likely also affects Synced Patterns (#68058 and
[59543]
), which are also fixed by this PR.Discovered while working on #69044, which is adding e2e test coverage for this exact scenario (and others).
Why?
It's a bug 🤷♂️
How?
By removing the
insert_hooked_blocks_into_rest_response
filter before adding GB's own version,gutenberg_insert_hooked_blocks_into_rest_response
.Testing Instructions
This is covered by end-to-end tests introduced by #69044. Follow that PR's instructions to run tests locally, and cherry-pick the commit from this PR on top to verify that it fixes the issue.