-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Custom post type lock breaks block recovery #49005
Comments
The expected behaviour is to recovery the block. However this is not possible due to a lock. |
I can reproduce the issue. When a template is locked, we should probably do a more granular check inside |
Yeah, it's a difficult one to solve. Maybe introducing a An observation - I notice that when an invalid block has 'prevent removal' active, it can still be recovered 🤔 |
@talldan exactly what I was thinking: introduce a canReplaceBlock can also be used to insert pattern. For example if pattern selected match root block, it will be replaced, otherwise skipped. Another solution can be to introduce a block limit count on post type that will act as a locker. |
Description
Adding a template lock can break the block recovery.
This line prevent block recovery:
gutenberg/packages/block-editor/src/store/selectors.js
Line 1538 in 605aeb0
Step-by-step reproduction instructions
core/group
template_lock: 'insert'
core/group
addin something likedata-foo="bar"
Do the same steps on a normal post/page. The recovery works great if you try the recovery on a post/page.
Screenshots, screen recording, code snippet
No response
Environment info
No response
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
The text was updated successfully, but these errors were encountered: