umbraco / Umbraco-CMS

Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
https://umbraco.com
MIT License
4.49k stars 2.69k forks source link

Property set to mandatory and using MNTP validates as invalid inside block #14484

Open bjarnef opened 1 year ago

bjarnef commented 1 year ago

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

11.4.1

Bug summary

I added a property using MTNP inside a block inserted in Block Grid editor and the property is configured as mandatory, but on save it validates as invalid even though a node is selected.

image

Specifics

No response

Steps to reproduce

Add a property to a block element using MNTP and set property to mandatory. Insert the block in Block Grid and try to save or save & publish node.

Expected result / actual result

No response

github-actions[bot] commented 1 year ago

Hi there @bjarnef!

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 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.

Thanks, from your friendly Umbraco GitHub bot :robot: :slightly_smiling_face:

elit0451 commented 1 year ago

Hey @bjarnef 👋

Thanks for reaching out. Unfortunately, I can't reproduce the issue. Can you have a look at this video and let me know what I am missing?

https://github.com/umbraco/Umbraco-CMS/assets/21998037/791a40ab-442d-4561-b57c-d6305b62167c

bjarnef commented 1 year ago

Hi @elit0451

Odd I could reproduce it again - this time inside Block List.

https://github.com/umbraco/Umbraco-CMS/assets/2919859/08a0a2f9-7856-4ca6-9e1b-9b8c7ede8880

It seems to happen when I have existing content and and added a property "Site" using MNTP and set as mandatory.

Hitting save & publish then mark errors at all items, since none of them have value in "Site" property, but selecting a value doesn't invalidate the property on first attempt - I have to remove the selected item and select it once again and then the error disappears from the property and I can submit/close the overlay.

elit0451 commented 1 year ago

I managed to reproduce this now - it happens when you have existing content for the element type and you add ANY mandatory field. Saving and publishing will result in the "Value cannot be null" validation error even when you have filled out the mandatory field.

Screenshot 2023-07-05 at 08 30 47



I will mark this as up for grabs in case someone wants to give it a try. The workaround is to add the property as a non-mandatory, fill out the content and then make it mandatory.

github-actions[bot] commented 1 year ago

Hi @bjarnef,

We're writing to let you know that we would love some help with this issue. We feel that this issue is ideal to flag for a community member to work on it. Once flagged here, folk looking for issues to work on will know to look at yours. Of course, please feel free work on this yourself ;-). If there are any changes to this status, we'll be sure to let you know.

For more information about issues and states, have a look at this blog post.

Thanks muchly, from your friendly Umbraco GitHub bot :-)

bjarnef commented 1 year ago

Yes, it with MNTP the workaround is to remove the item selected first time and select it again. On second selection the validation is updated the be valid.