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

Template is created when creating element type #11285

Closed
bjarnef opened this issue Oct 5, 2021 · 7 comments · Fixed by #11283
Closed

Template is created when creating element type #11285

bjarnef opened this issue Oct 5, 2021 · 7 comments · Fixed by #11283
Labels

Comments

@bjarnef
Copy link
Contributor

bjarnef commented Oct 5, 2021

Which exact Umbraco version are you using? For example: 8.13.1 - don't just write v8

v8/contrib

Bug summary

With latest changes in v8/contrib branch when I create an element type, it also create a template.

Wpw8qP0sN6.mp4

Specifics

No response

Steps to reproduce

Create an element type and note that a template also is created.
The only action that should create a template is the "Document Type with Template" action from the context menu.

Expected result / actual result

No response

@bjarnef
Copy link
Contributor Author

bjarnef commented Oct 5, 2021

It doesn't happen when creating a document type and switch the toggle at "Is an Element Type".

X7cu2h1dH1.mp4

@bjarnef
Copy link
Contributor Author

bjarnef commented Oct 5, 2021

The /umbraco/backoffice/UmbracoApi/ContentType/PostSave set the following payload:

image

Not sure why it set template value, when this is an element type. What has changed? 🤔

@bjarnef
Copy link
Contributor Author

bjarnef commented Oct 5, 2021

I just tried on a v9.0.0 project, where it doesn't happen.

@nul800sebastiaan do you have a clue on what has changed here? 😬

@bjarnef
Copy link
Contributor Author

bjarnef commented Oct 5, 2021

Ahh it seems it also is related to #11008

The createElement() function has changed to not set notemplate param, so it creates a template. It also happened when creating a composition.

Note that is previous set nottemplate param here:
https://github.com/umbraco/Umbraco-CMS/pull/11008/files#diff-799c6d7b5a03dd76b5cb7ffa6aee4d780f8c3d80b13f19481b6afa34d0e2926cL77

and here:
https://github.com/umbraco/Umbraco-CMS/pull/11008/files#diff-799c6d7b5a03dd76b5cb7ffa6aee4d780f8c3d80b13f19481b6afa34d0e2926cL85

All had create param that is set here now, which should be fine
https://github.com/umbraco/Umbraco-CMS/pull/11008/files#diff-799c6d7b5a03dd76b5cb7ffa6aee4d780f8c3d80b13f19481b6afa34d0e2926cR75

Fixed in 0170d2a

@BarryFogarty
Copy link

BarryFogarty commented Oct 6, 2021

NB I have just created #11300 which sounds like it might also relate to this issue?

@bjarnef
Copy link
Contributor Author

bjarnef commented Oct 6, 2021

@BarryFogarty no, not not same issue. This issue here is that the refactoring in #11008 changed the behavior so it no longer set the nottemplate and thus create a template by default.

Btw. creating a composition shouldn't set "Is Element Type" toggle. A composition is just a document type, not an element type.

@nul800sebastiaan
Copy link
Member

Fixed in #11283

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants