Umbraco-Validation-Attributes
Umbraco-Validation-Attributes copied to clipboard
Umbraco Validation Attributes plugin fails to load dictionary values in Umbraco v7.1.9 +
I have been using this package with Umbraco v7 for some time all the way up to 7.1.6 but after recently starting a new project in v7.1.9 I have found that the support is patchy.
@UmbracoValidationHelper.GetDictionaryItem("itemName") appears to function correctly however when using the following model:
public class NewsletterModel
{
[UmbracoEmail(ErrorMessageDictionaryKey = "Newsletter.Error.Email")]
[UmbracoRequired("Newsletter.Error.Required")]
[UmbracoDisplayName("Newsletter.Email")]
public string EMAIL { get; set; }
[UmbracoRequired("Newsletter.Error.Required")]
[UmbracoDisplayName("Newsletter.Forename")]
public string MMERGE4 { get; set; }
[UmbracoRequired("Newsletter.Error.Required")]
[UmbracoDisplayName("Newsletter.Surname")]
public string LNAME { get; set; }
}
And the following method of rendering the label in the view:
<div class="form-group clearfix">
@Html.LabelFor(model => model.MMERGE4, new { @class = "control-label col-md-3" })
<div class="col-md-9">
@Html.TextBoxFor(model => model.MMERGE4, new { @class = "form-control input-sm", aria_required = "true", required = "true" })
</div>
@Html.ValidationMessageFor(model => Model.MMERGE4)
</div>
no labels are presented meaning the dictionary retrieval method may need altering. I have tried updating the package dependencies using NuGet as a last ditch attempt to get it to work but updating the UmbracoCms.Core to 7.1.9 does nothing and trying to update all of the other dependencies produces the following error:
Install failed. Rolling back...
Updating 'Microsoft.AspNet.Mvc 4.0.30506.0' to 'Microsoft.AspNet.Mvc 5.2.2' failed. Unable to find a version of 'UmbracoCms.Core' that is compatible with 'Microsoft.AspNet.Mvc 5.2.2'.