-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Remove locking inheritance. Add template lock attribute to some blocks #25869
Remove locking inheritance. Add template lock attribute to some blocks #25869
Conversation
Size Change: +12 B (0%) Total Size: 1.19 MB
ℹ️ View Unchanged
|
f076250
to
a186f27
Compare
ad26b26
to
528ea78
Compare
528ea78
to
bd322d9
Compare
bd322d9
to
6594800
Compare
Do we want this to be automatic or should it be a support flag or something? |
Hi @youknowriad, I think it should be automatic, I don't think we will have a case where:
I think we don't need a support flag for this the fact the block adds a templateLock attribute is already an opt-in for this system. I guess the supports flag would make sense if with the flag we remove the need to add the attribute. Adding the support flag would automatically add the attribute. Would you prefer this approach? |
I'm not sure yet, I'm still trying to understand the consequences. Also, I think we probably need something similar for allowedBlocks don't you think if we go the "API" route? Do you think it makes sense to start small and only add support for this in specific blocks (say column, and group) |
Hi @youknowriad, So if we followed this approach. We would remove: Would you be able to confirm if this matches your idea? It seems like a safe and good first step. |
@jorgefilipecosta yes, it does. |
It is potentially impactful though, so I'm wondering whether we should include on 5.6 or not. |
For 5.6 we decided to test the attributes mechanism on columns and group block and remove any breaking changes like the inheritance removal to test this system so I'm closing this PR. |
The attribute addition to columns and groups is proposed at #26128. |
Fixes: #23329
This PR removes the locking inheritance. This change may have an impact on existing blocks and CPT templates and needs a dev not.
Besides removing inheritance it implements a mechanism where if a block explicitly contains an attribute with the name templateLock, that attribute is automatically used as the templateLock of the inner blocks area.
Multiple template lock attributes were added to existing blocks. All these changes allow, CPT template creators, blocks, and patterns to explicitly specify the locking of the blocks that are used.
Testing
I verified now locking is not inherited by using sample cpt templates, and sample blocks with inner block templates.
I verified I could control the locking of the group block by using the templateLock attribute.
By pasting the following code on the code editor I verified that the first group block is not locked, while the second group block is locked.