You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)
13.5.1
Bug summary
The purpose of Single Block Mode is to help the Models Builder in giving us a single block item (for building fields which are meant to have only a single block item, and not many, such as adding a single re-usable Widget block to many pages, for example)
However, such single blocks, don't always necessarily need to exist on a page, they could be optional.
The current configuration of a block list in single mode requires the following settings:
Single Block Mode enabled
Only a given block type allowed in the list
Minimum 1 block
Maximum 1 block
When such a block list gets added to a document type as a field, it will cause the field to essentially become mandatory / you won't be able to save the page unless a block of the given list type is added to the document.
Is there a design decision somewhere that prevents the following configuration from also making ModelsBuilder generate a BlockListItem<T> with an empty list returning default(T)?
Single Block Mode enabled
Only a given block type allowed in the list
Minimum 0 block
Maximum 1 block
The mandatory/optional nature of the field would then instead be controlled by the document that uses it.
Thoughts? The current way it works essentially renders Single Block Mode useless unless the fields it is going to be used are always mandatory by nature of the document type anyways.
Specifics
No response
Steps to reproduce
Have a default site installation with ModelsBuilder set to SourceCodeAuto
Create a Element/block document type, can be anything
Create a Block List data type that uses said Element type as its only allowed type and enable single block mode + make max amount 1 and minimum amount 1
Create a document type (not an element), with a single property that uses said block list as it's editor, leave it as optional, make it so it can be created as a root component
A model will be created with the property set as type BlockListItem<T>
Create said document in the content tree and give it a name.
Try to save the document, it won't allow to save, even though the property is optional
Modify the created block list data type to have a minimum of 0 elements instead
a. Leaving single block mode enabled or not at this point is irrelevant but try any steps after this with both
Save the block list type and go back to the document in the content tree
The document will not be save-able without the property being filled in
The generated model will however revert back to a BlockListModel, instead of being BlockListItem<T>
Expected result / actual result
Have a default site installation with ModelsBuilder set to SourceCodeAuto
Create a Element/block document type, can be anything
Create a Block List data type that uses said Element type as its only allowed type and enable single block mode + make max amount 1 and minimum amount 1
Create a document type (not an element), with a single property that uses said block list as it's editor, leave it as optional, make it so it can be created as a root component
A model will be created with the property set as type BlockListItem<T>
Create said document in the content tree and give it a name.
Try to save the document, it won't allow to save, even though the property is optional
Modify the created block list data type to have a minimum of 0 elements instead
a. Leave single block mode turned on
Save the block list type and go back to the document in the content tree
The document will now be save-able without the property being filled in
The generated model remains a BlockListItem<T>, but when the value is empty in a given page/document in the CMS, the property will have default(T) as it's value when processing the ModelsBuilder generated model of the page
The text was updated successfully, but these errors were encountered:
Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.
We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.
We'll assess whether this issue relates to something that has already been fixed in a later version of the release that it has been raised for.
If it's a bug, is it related to a release that we are actively supporting or is it related to a release that's in the end-of-life or security-only phase?
We'll replicate the issue to ensure that the problem is as described.
We'll decide whether the behavior is an issue or if the behavior is intended.
We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.
Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)
13.5.1
Bug summary
The purpose of Single Block Mode is to help the Models Builder in giving us a single block item (for building fields which are meant to have only a single block item, and not many, such as adding a single re-usable Widget block to many pages, for example)
However, such single blocks, don't always necessarily need to exist on a page, they could be optional.
The current configuration of a block list in single mode requires the following settings:
When such a block list gets added to a document type as a field, it will cause the field to essentially become mandatory / you won't be able to save the page unless a block of the given list type is added to the document.
Is there a design decision somewhere that prevents the following configuration from also making ModelsBuilder generate a BlockListItem<T> with an empty list returning default(T)?
The mandatory/optional nature of the field would then instead be controlled by the document that uses it.
Thoughts? The current way it works essentially renders Single Block Mode useless unless the fields it is going to be used are always mandatory by nature of the document type anyways.
Specifics
No response
Steps to reproduce
a. Leaving single block mode enabled or not at this point is irrelevant but try any steps after this with both
Expected result / actual result
a. Leave single block mode turned on
The text was updated successfully, but these errors were encountered: