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

Fix core/column not having templateLock inherited from posttype template #17301

Closed
wants to merge 3 commits into from

Conversation

oxyc
Copy link
Member

@oxyc oxyc commented Sep 2, 2019

Description

See #17262 although this only fixes the inconsistency, not the issues expected behavior which I personally disagree with.

Basically core/column sets the templateLock to false to override the parent core/columns blocks all. This however doesn't take into account the post type templateLock.

This PR inherits the templateLock from the parent of the parent core/columns block.

How has this been tested?

Added a locked post type template with a column block and verified it's not possible to add child blocks. On an unlocked post type template, it is still possible to add.

Types of changes

Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.

Copy link
Member

@jorgefilipecosta jorgefilipecosta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some possible improvements in the comments. Personally I feel this is a positive change. Thank you for your contribution 👍

packages/block-library/src/column/edit.js Outdated Show resolved Hide resolved
packages/block-library/src/column/edit.js Outdated Show resolved Hide resolved
packages/block-library/src/column/edit.js Outdated Show resolved Hide resolved
@talldan talldan 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 Sep 4, 2019
@oxyc oxyc force-pushed the core-column-templatelock branch 2 times, most recently from 8875bd7 to 92f9779 Compare September 13, 2019 13:14
@oxyc oxyc requested a review from jorgefilipecosta October 14, 2019 09:45
@oxyc oxyc force-pushed the core-column-templatelock branch from 92f9779 to db6e3c5 Compare June 13, 2020 17:37
@oxyc oxyc force-pushed the core-column-templatelock branch from db6e3c5 to 8697b04 Compare June 13, 2020 17:44
@oxyc oxyc mentioned this pull request Jun 19, 2020
6 tasks
Base automatically changed from master to trunk March 1, 2021 15:42
@t-hamano
Copy link
Contributor

t-hamano commented Sep 8, 2022

Hi @oxyc,

For this issue, templateLock attribute has been added to the columns block in #26128.
Then in #42677, the column block was fixed to also inherit the global template_lock of the post type.

Therefore, sorry, this PR is closed.
If there is anything I have missed, please feel free to comment.

@t-hamano t-hamano closed this Sep 8, 2022
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 [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants