umbraco / Umbraco.UIBuilder.Issues

Back office UI builder for Umbraco
3 stars 2 forks source link

Entity Picker used in Konstrukt editor has validation issues #61

Closed drpeck closed 9 months ago

drpeck commented 1 year ago

Describe the bug My IKonstruktConfigurator sets a Field for my Editor, that uses an Entity Picker. Field is required. If you trigger validation such that validation fails, because an entity has not been picker, it is not possible to clear the validation error by subsequently picking an editor.

Worse still, the issue appears to persist when you load another entity in to the Editor that has the property in question populated. The page must be refreshed (F5) to clear the validation errors. Even changes Sections doesn't clear the issue

Steps To Reproduce Steps to reproduce the behavior:

        treeConfig.AddCollection<ResourceModel>(x => x.Id, "Resource", "Resources", "A resource entity", "icon-book", "icon-books", collectionConfig => collectionConfig
            .SetRepositoryType<ResourcesRepository>()
                .SetNameProperty(p => p.Name)

                .Editor(editorConfig => editorConfig
                    .AddTab("Meta data", tabConfig => tabConfig
                        .AddFieldset("Discover", fieldsetConfig => fieldsetConfig
                            .AddField(p => p.Topics)
                                .SetDataType(Constants.DataTypeNames.TopicsPicker)
                                .SetValueMapper<TopicValueMapper>()
                                .MakeRequired()
                        )
                    )
                )
        )
  1. Create an entity with an Entity Picker field that is required
  2. Try to add a new entity by only entering a name (Entity Picker field is empty)
  3. Receive validation error
  4. Populate the Entity Picker field, and click Save

Expected behavior Entity should Save

Screenshots

image

Environment (please complete the following information):

Additional context NB: I'm using the beta version still.


This item has been added to our backlog AB#34768

drpeck commented 1 year ago

I'm now using 1.6.5 with no change

jemayn commented 10 months ago

I experienced the same with a property that had MakeRequired() as validation, then I filled in the value and tried to save again, and the save button was unresponsive. Had to refresh the page to get it to work.

acoumb commented 9 months ago

Hi @drpeck ,

I have released version 12.0.2 of Umbraco.UIBuilder with a fix to this issue.

Thank you, Adrian