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

Editing bound paragraph in post editor causes "Site Updated" message to appear #62236

Open
artemiomorales opened this issue Jun 3, 2024 · 0 comments · May be fixed by #63223
Open

Editing bound paragraph in post editor causes "Site Updated" message to appear #62236

artemiomorales opened this issue Jun 3, 2024 · 0 comments · May be fixed by #63223
Assignees
Labels
[Feature] Block bindings [Type] Bug An existing feature does not function as intended

Comments

@artemiomorales
Copy link
Contributor

artemiomorales commented Jun 3, 2024

Description

In the post editor, if one modifies a block connected to post metadata via block bindings, a "Site Updated" notification displays when saving the post, which is incorrect.

First raised in #61811 and a part of the block bindings iteration for WordPress 6.6.

Step-by-step reproduction instructions

1. Register post meta by adding this snippet to your theme's functions.php
add_action( 'init', 'test_block_bindings' );

function test_block_bindings() {
	register_meta(
		'post',
		'text_field',
		array(
			'show_in_rest'      => true,
			'single'            => true,
			'type'              => 'string',
			'default'           => 'default text value',
		)
	);
}
2. In the post editor, add a paragraph block bound to the custom field using the Code Editor
<!-- wp:paragraph {"metadata":{"bindings":{"content":{"source":"core/post-meta","args":{"key":"text_field"}}}}} -->
<p>Paragraph content</p>
<!-- /wp:paragraph -->
  1. Press the Save button.
  2. Notice that the "Site Updated" message appears, despite the fact that you made no site-wide changes.

Screenshots, screen recording, code snippet

site-updated-bug

Environment info

  • Gutenberg Release Candidate 18.5

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block bindings [Type] Bug An existing feature does not function as intended
1 participant