Umbraco-cms: Using dropdown.flexible on a member saves empty string when set on mandatory.

Created on 1 Nov 2018  路  4Comments  路  Source: umbraco/Umbraco-CMS

Bug summary

I was made aware that if you create a new member-type which uses the umbraco.dropdown.flexible, as a mandatory property, then you would be able to save this new member without selecting anything from the dropdown.

Here is what is happening: if anything hasn't been picked then it would save the member with an empty string in the dropdown property. This would satisfy the property, as it technically has a value saved on the member.

Specifics

Version of Umbraco: 7.12.3
Browser: Chrome, Firefox and Internet Edge.

Images:
image
image

Steps to reproduce

  1. Create a new member-type.
  2. Assign it the property of the dropdown editor and make sure it is on mandatory.
  3. Give the dropdown editor at least 1 prevalue.
  4. Save the new membertype.
  5. Create a new member using the newly created membertype.
  6. Fill out the necessary information for this new member, except mandatory dropdown.
  7. Save the member.
  8. Find the new member in the membersection and see that the dropdown property is still on the empty string.

Expected result

I would have expected that it gave me a validation error as the user who created the member has not picked anything in the dropdown property.

Actual result

It saved the member just fine.
There is no error messages that popups to help identify what is going on.

communitpr releas7.13.0 typbug

All 4 comments

Bad news. This is a problem on documents as well. I'm looking into it now.

I've recreated this in both Members and Content docs.

I can see how to fix this for simple, single selections. The angular attribute ng-required="model.validation.mandatory" is missing.

Putting this in Umbraco.Web.UI.Client\src\views\propertyeditors\dropdownFlexible\dropdownFlexible.html to fixes it for both members and content but not for the multi-select (there is a switch for this but adding this attribute is ignored here).

It seems that this flexible was created under https://github.com/umbraco/Umbraco-CMS/pull/2502 so there is a dropdown and dropdownflexible.. guessing it's to support legacy. Not sure if to put this attribute on both?!

@cheeseytoastie you're right 馃槃 check the PR in #3504.

Doh! Wish I'd spotted that. I've just tested your changes and they work a treat for this issue.

Was this page helpful?
0 / 5 - 0 ratings