Block Hooks: Fix duplicated insertion in Post Content#69142
Merged
Conversation
5 tasks
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. |
gziolo
approved these changes
Feb 14, 2025
gziolo
left a comment
Member
There was a problem hiding this comment.
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 😅
ockham
added a commit
that referenced
this pull request
Feb 20, 2025
* Block Hooks: Fix duplicated insertion in Post Content * Add backport changelog * Move function def and filters inside conditional Co-authored-by: ockham <bernhard-reiter@git.wordpress.org> Co-authored-by: gziolo <gziolo@git.wordpress.org>
Contributor
Author
|
I've cherry-picked 3df54ec to the |
Kallyan01
pushed a commit
to Kallyan01/gutenberg
that referenced
this pull request
Feb 24, 2025
* Block Hooks: Fix duplicated insertion in Post Content * Add backport changelog * Move function def and filters inside conditional Co-authored-by: ockham <bernhard-reiter@git.wordpress.org> Co-authored-by: gziolo <gziolo@git.wordpress.org>
chriszarate
pushed a commit
to chriszarate/gutenberg
that referenced
this pull request
Jul 1, 2025
* Block Hooks: Fix duplicated insertion in Post Content * Add backport changelog * Move function def and filters inside conditional Co-authored-by: ockham <bernhard-reiter@git.wordpress.org> Co-authored-by: gziolo <gziolo@git.wordpress.org>
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.
What?
In the editor, hooked blocks are currently inserted twice into post content (when using the GB plugin on a WP
trunkinstall).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_responsefilter 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.