mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
#20736: Fixing post when adding no value to new tag name
Work Item: 20736
This commit is contained in:
@@ -74,10 +74,10 @@ namespace Orchard.Tags.Controllers {
|
||||
|
||||
var viewModel = new TagsAdminCreateViewModel();
|
||||
|
||||
TryUpdateModel(viewModel);
|
||||
|
||||
if (viewModel.TagName.Intersect(TagsPartDriver.DisalowedChars).Any()) {
|
||||
ModelState.AddModelError("_FORM", T("The tag \"{0}\" could not be added because it contains forbidden chars: {1}", viewModel.TagName, String.Join(", ", TagsPartDriver.DisalowedChars)));
|
||||
if (TryUpdateModel(viewModel)) {
|
||||
if (viewModel.TagName.Intersect(TagsPartDriver.DisalowedChars).Any()) {
|
||||
ModelState.AddModelError("_FORM", T("The tag \"{0}\" could not be added because it contains forbidden chars: {1}", viewModel.TagName, String.Join(", ", TagsPartDriver.DisalowedChars)));
|
||||
}
|
||||
}
|
||||
|
||||
if(!ModelState.IsValid) {
|
||||
|
Reference in New Issue
Block a user