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 Template Warning Missing in 5.2 #15743

Closed
benplum opened this issue May 20, 2019 · 2 comments · Fixed by #15418
Closed

Block Template Warning Missing in 5.2 #15743

benplum opened this issue May 20, 2019 · 2 comments · Fixed by #15418
Assignees
Labels
[Feature] Templates API Related to API powering block template functionality in the Site Editor [Priority] High Used to indicate top priority items that need quick attention [Type] Bug An existing feature does not function as intended

Comments

@benplum
Copy link

benplum commented May 20, 2019

Describe the bug
Prior to 5.2, a warning was displayed when a post's current blocks did not match the defined block template. The warning contained an option to reset the post to match the block template.

To reproduce
Steps to reproduce the behavior:

  1. Edit or add a block template to a post type.
  2. Edit an existing post of that type.
  3. See that the warning is missing.

Expected behavior
A warning should be displayed, with an option for the user to reset the block template.

I know there was an issue where the warning would also display when the post type's block template contained a locked set of outer blocks, and unlocked set of inner blocks. If I had to choose one, I'd rather have an ever-present warning than no way to reset the block template.

I've attempted a work around using:

wp.data.dispatch('core/editor').resetBlocks([]);
wp.data.dispatch('core/editor').insertBlocks( ... );

However this fails if template_lock is on. (Also, how should wp.data.dispatch( 'core/editor' ).synchronizeTemplate(); work?)

@youknowriad youknowriad added [Type] Bug An existing feature does not function as intended [Feature] Templates API Related to API powering block template functionality in the Site Editor labels May 21, 2019
@youknowriad
Copy link
Contributor

cc @jorgefilipecosta in case you have an idea about this.

@benplum
Copy link
Author

benplum commented Jul 8, 2019

Thanks, the warning is back. Hope #11681 get some attention soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Templates API Related to API powering block template functionality in the Site Editor [Priority] High Used to indicate top priority items that need quick attention [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants