mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Fixing a bug with editing content types when there's a model error
--HG-- branch : dev
This commit is contained in:
@@ -86,7 +86,11 @@ namespace Orchard.ContentTypes.Controllers {
|
|||||||
if (typeViewModel == null)
|
if (typeViewModel == null)
|
||||||
return HttpNotFound();
|
return HttpNotFound();
|
||||||
|
|
||||||
if (!TryUpdateModel(typeViewModel))
|
var edited = new EditTypeViewModel();
|
||||||
|
TryUpdateModel(edited);
|
||||||
|
typeViewModel.DisplayName = edited.DisplayName;
|
||||||
|
|
||||||
|
if (!ModelState.IsValid)
|
||||||
return View(typeViewModel);
|
return View(typeViewModel);
|
||||||
|
|
||||||
_contentDefinitionService.AlterType(typeViewModel, this);
|
_contentDefinitionService.AlterType(typeViewModel, this);
|
||||||
|
Reference in New Issue
Block a user