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

Using dropdown.flexible on a member saves empty string when set on mandatory. #3500

Closed
Frost117 opened this issue Nov 1, 2018 · 4 comments
Closed

Comments

@Frost117
Copy link

Frost117 commented Nov 1, 2018

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.

@kjac
Copy link
Contributor

kjac commented Nov 2, 2018

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

@kjac kjac mentioned this issue Nov 2, 2018
1 task
@cheeseytoastie
Copy link
Contributor

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 #2502 so there is a dropdown and dropdownflexible.. guessing it's to support legacy. Not sure if to put this attribute on both?!

@kjac
Copy link
Contributor

kjac commented Nov 8, 2018

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

@cheeseytoastie
Copy link
Contributor

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

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

No branches or pull requests

5 participants