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

Return inside Titel creates new block despite template_lock set on CPT #14307

Closed
Drivingralle opened this issue Mar 7, 2019 · 3 comments
Closed
Labels
[Type] Bug An existing feature does not function as intended

Comments

@Drivingralle
Copy link

Describe the bug
I register a custom post type with the tempalte lock argement set for the whole post type. I also add some blocks into the psot type as block tempalte.

$args = array (
    [...]
    'template_lock'       => 'all',
    [...]
);

As I create a new post of my post type the block tempalte is loaded. There are no block inserter button in the tool bar. And no block inserter showing up on the blocks directly.

BUT as I enter a title and hit enter a new block right below the title and above the first block of my tempalte is inserted.

To Reproduce
Steps to reproduce the behavior:

  1. Have custom post type registed that uses Gutenberg
  2. Add a few blocks as a block template for the CPT
  3. Add the tempalte lock to the CPT
  4. Create a new post of the CPT
  5. Check thst no block inserter is visible
  6. Enter any title and hit ENTER

Expected behavior
No new block beeing added.

Screenshots
https://cloudup.com/cV3dsaLfdJg

Desktop (please complete the following information):

  • OS: MacOS 10.14.3
  • Browser Firefox 65.0.1
  • Version WP 5.1
@youknowriad youknowriad added the [Type] Bug An existing feature does not function as intended label Mar 7, 2019
@youknowriad
Copy link
Contributor

Seems related to the work you were doing recently right @jorgefilipecosta to avoid inserting not allowed blocks?

@jorgefilipecosta
Copy link
Member

Exactly I think as soon as we merge the restrictions PR #14003 this issue will be fixed.

@jorgefilipecosta
Copy link
Member

#14003 was merged and I confirmed the problem is fixed in the last version of Gutenberg. Thank for reporting this issue @Drivingralle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants