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

Block Hooks: Fix duplicated insertion in Post Content #69142

Draft
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

ockham
Copy link
Contributor

@ockham ockham commented Feb 11, 2025

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 Core trunk.

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

TBD

Testing Instructions for Keyboard

Screenshots or screencast

Before After

@ockham ockham self-assigned this Feb 11, 2025
@ockham ockham added [Type] Bug An existing feature does not function as intended [Feature] Block hooks labels Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block hooks [Type] Bug An existing feature does not function as intended
Projects
Status: 🏗️ In Progress
Development

Successfully merging this pull request may close these issues.

1 participant