When a string property is decorated with an EmailAddressAttribute validation fails when removing the address. This occurs on a fresh Alloy site with all the latest updates.
How to reproduce:
- Create a new Alloy site
- Add a string property with EmailAddressAttribute to a content type, I used ContactBlock and added:
- [Display(Order = 30), EmailAddress]
- public virtual string Email { get; set; }
- Create a block in the CMS, set an email address, and publish
- Edit the block and erase the email address
Here validation fails with: The Email field is not a valid e-mail address.
Sent via Dojo to the server in the post body is: {"id":"113_116","properties":{"email":"\"\""},"action":513}
As an editor this can be worked around by leaving the property blank, switching to another property and changing that after which validation succeeds and nothing is sent for the property.
Is this a known bug? Is there a fix available?