Fixing a bug with editing content types when there's a model error

--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-11-10 16:35:59 -08:00
parent b4bfd909e5
commit ac1cdf7c03

View File

@@ -86,7 +86,11 @@ namespace Orchard.ContentTypes.Controllers {
if (typeViewModel == null)
return HttpNotFound();
if (!TryUpdateModel(typeViewModel))
var edited = new EditTypeViewModel();
TryUpdateModel(edited);
typeViewModel.DisplayName = edited.DisplayName;
if (!ModelState.IsValid)
return View(typeViewModel);
_contentDefinitionService.AlterType(typeViewModel, this);