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

Closed
artemiomorales opened this issue Jun 3, 2024 · 2 comments
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

@artemiomorales artemiomorales added [Type] Bug An existing feature does not function as intended [Feature] Block bindings labels Jun 3, 2024
@gziolo gziolo moved this to 🏗️ In Progress in WordPress 6.6 Editor Tasks Jun 3, 2024
@artemiomorales artemiomorales self-assigned this Jun 3, 2024
@SantosGuillamot
Copy link
Contributor

The changes to trigger the save panel after editing post meta in a post have been reverted in this pull request. I guess this is not an issue anymore and we just have to ensure that whatever we build doesn't trigger this again, right?

I've opened this new issue to gather all the context and make decisions before working on a new solution.

Should we close this one?

@artemiomorales
Copy link
Contributor Author

The changes to trigger the save panel after editing post meta in a post have been reverted in #63412. I guess this is not an issue anymore and we just have to ensure that whatever we build doesn't trigger this again, right?

Yup, we can close this issue. And yes, we just need to make sure the "Site Updated" message doesn't get triggered with any new implementation.

I've opened this new issue to gather all the context and make decisions before working on a new solution.

Should we close this one?

Yes let's keep all the discussion in the new issue and close this one 👍

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
Projects
None yet
Development

No branches or pull requests

2 participants